I found something interesting with the NaN property in javascript. The NaN property in javascript indicates that a value is "Not a Number". Take a look at the example below:
So is the 'value' variable a number or not a number?
So is the 'value' variable a number or not a number?
December 22nd, 2007 at 08:15 AM It's not a number - in the literal numeric value sense and not the class/object 'type' sense. Another weird thing you can do is: value instanceof Number or even value instanceof YourCustomPrototypicalType Yahoo's version would be more in line with the language as a language and prototype's is probably their attempt at making it more developer friendly - NaN is probably just some of the language authors varied language roots showing through in to this one. (i'm sure writing the impl of it and its companion browser in c++ all day long does make it stick sometimes)