How to create an API that receives JSON with Node.js and Express [20 of 26]

Play How to create an API that receives JSON with Node.js and Express [20 of 26]

The Discussion

  • User profile image
    chety1
    Hi,

    By the way isNaN is not the right way to check NaN in my opinion. Because isNaN("buggy") -> returns true also. We can check by Number.isNaN("fishy") or Object.is("fishy",NaN)
  • User profile image
    sinedied
    @chety1:

    Hi chety1, you're technically correct. Though in the particular case of the video either isNaN or Number.isNaN works as it's following a parseFloat() instruction, which will return either a number or NaN, so no edge case here ;)

    But you're right as Number.isNaN() is often the one that should be used.

Add Your 2 Cents