4 ms·
JSON looks more-or-less like a Python dict, but you still wouldn't be able to parse {"x": NaN} or {"x": Infinity}
by kibibu 13y ago
JSON looks more-or-less like a Python dict, but you still wouldn't be able to parse {"x": NaN} or {"x": Infinity}
- derefr 13y agoOddly, there's actually no language that I know of that has NaN and Infinity constants. Many languages pretty-print those float values that way, but none of the parsers can interpret them back in.
- GeneralMayhem 13y ago...do you mean other than JavaScript? They're not actually parser-level constants, they're just defined as globals/on the window object, but they work.