+ 2
NaN problem in JS
Why the result false a = isNaN(Number("abc")) // return true b = (Number("abc")==NaN) // return false Why a is true and b is false, Number("abc"), return NaN but why b return false. If we make another code like this c = NaN==NaN // return false Will return false, idk whats wrong https://code.sololearn.com/cqmB9liD7YM0/?ref=app
2 Answers
+ 2
Check de MDN doc of NaN
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN
Theres a section labeled as Testing against NaN.
+ 2
Arturop oh ok, thanks for answer my question đ