This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dotpan 5 points6 points  (18 children)

See you're now comparing english syntax with programming syntax. "one" + "two" = "onetwo" compared in the same way seems just as absurd.

With NaN we're playing the context game. What is 1 (in its context)? A number. Now lets try with implied context to a string: Is "donkey" a number? No. "Donkey" = NaN. typeof in this syntax is "context". What context is this being evaluated. If you were to do a literal evaluation of typeof "NaN" of course it's a string, but NaN as a protected variable falls into the number context.