[Javascript] NaN

Peter Brunone peter at brunone.com
Wed Nov 20 10:16:44 CST 2002


Iztok,

   You are checking to see if x is equal to the string "NaN", which of course it never is.  I'm not sure if you can use an equality to check for NaN, but the function isNaN(x) will return a boolean (true/false) value that you can use.

Cheers,

Peter

---------- Original Message ----------------------------------
From: "Iztok Polanic" <iztokp at amis.net>
Reply-To: javascript at LaTech.edu
Date: Wed, 20 Nov 2002 11:43:47 +0100

>Hi!
>
>I was trying to catch NaN (Not a Number) via
>x = Number(something);
>if (x == "NaN") {
>...
>}
>and it does not work. Why? I'm using IE 6.0 and JS 1.5. Can somebody tell me
>what cained of error is IE 5.x throwing back to user?
>TNX!
>
>Bye,
>
>Iztok
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript
>



More information about the Javascript mailing list