You are viewing a single comment's thread from:

RE: When JavaScript is trolling you

in #javascript7 years ago

In JavaScript, false and 0 are not strict equally. Since it’s not a strong typed language, isNaN will considere 0 and return as false. Nowadays you can use isNumber to strictly check that. It’s safer.

Sort:  

Yes. What really made me want to throw a fit was when an empty string passed. I used isNumber()

LOL, no I didn't ...

Screenshot of JavaScript console showing ! isNaN() in use

Coin Marketplace

STEEM 0.17
TRX 0.12
JST 0.028
BTC 56420.74
ETH 2938.55
USDT 1.00
SBD 2.22