|
script.SpecialNumber = "NaN" / "-0" / "Infinity" / "-Infinity"; |
-0 is valid number in json. If BiDi requires it to be String, then consumers will write extra code to serialize/deserialize this "-0" special case. If -0 would be a normal number, then serialization/deserialization properly handles it out of the box, including NaN, Infinity and -Infinity.
Note: Firefox properly handles both -0 and "-0", Chromium works only with "-0" and doesn't allow -0.