Jakob said: Were copious amounts of drugs involved in the design of JS? Its type conversion behaviour seems to be about as predictable as a drunk monkey throwing darts... This isn't (entirely) the fault of JS in this case. JSON doesn't include NaN, Infinity, -Infinity, or undefined. Of course, the reason JSON doesn't include those things is the fault of JS... because those are not actually JS keywords, they are actually properties of the global object, and their value could potentially be changed. The design philosophy of JSON is such that eval(jsonString) or JSON.parse(jsonString) should always produce the same result, no matter the environment's state. JSON is a subset of ECMAScript which only includes literal values, which means no property lookups. Since these things are properties of the global object, each use is a property lookup. Even executing 1/0 will perform a lookup on the NaN property, and if that property has been redefined... NaN = { valueOf: function() { /* do evil */ } }