JS ISNAN

Standard

isNaN()
calling isNaN on something, checks if that thing is not a number

isNaN(“banana”);
// true

isNaN(NaN);
// true

isNaN(undefined);
// true

isNaN(42);
// false

but calling isNaN on a string that looks like a number, like “42”, javascript will try to help by automatically converting the string to the number 42 and return false (since 42 is a number)

this syntax can’t be used if the variable hasn’t been declared earlier
isNaN(dogs);

Advertisements

say something

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s