NaN stands for Not a Number : Introdunction : Number Data Type JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Number Data Type » Introdunction »

 

NaN stands for Not a Number













NaN is an odd special value.

In general, this occurs when conversion from another type fails.

NaN cannot be used in mathematical calculations.

NaN is not equal to itself.








alert(NaN == NaN);    //outputs "false"



It is not recommended to use the NaN value itself.

Instead, you can use the function isNaN().








alert(isNaN("blue"));
alert(isNaN("123"));







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Number Data Type
» Introdunction