Came across some interesting Tip for JavaScript developers.
#JavaScript tip for today:
— Tomek Sułkowski (@sulco ) October 2, 2019
Number.isNaN is not isNaN.
Wait, what?!
Yes, the globalisNaN
returns true for some unexpected values ({}, "hello", undefined), whileNumber.isNaN
will only return true for the actualNaN
. pic.twitter.com/b0CftzrIGB
Top comments (0)