+ 3
What is the meaning of NaN??
3 Réponses
+ 11
NaN means Not a Number. However it is necessarily not a char or bool or something else. Thats only the case with parseInt function.
NaN is a built in object which turns up if you did something that should not be a valid no.
Eg.
0/0
"hello"-5
parseInt("hello")
undefined+1
Btw, NaN belongs to the primitive type number.
+ 8
"Not a Number"
It could be a char or a boolean or something else!
Examples:
alert(parseInt("A string")); // alerts NaN
alert(parseInt(true)); // alerts NaN