Can I write a isNan() function with JavaScript? Can JavaScript check for sure that a variable is NaN
without native isNaN
function?
This is a interview question.
If it is a number, and is not equal to itself, it is NaN.
Note: As @pst has pointed out, the number constraint is unnecessary. NaN
appears to be the only value in JS != itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With