JSON NaN bug_NaNJSON NaN bug



JSON NaN bug

NaN is not valid in JSON

JSON NaN bug_NaN


JSON
JSON {Symbol(Symbol.toStringTag): "JSON", parse: ƒ, stringify: ƒ}parse: ƒ parse()stringify: ƒ stringify()Symbol(Symbol.toStringTag): "JSON"__proto__: Object

obj = {score: NaN}
{score: NaN}score: NaN__proto__: Object

JSON.stringify(obj);
"{"score":null}"

JSON.parse(JSON.stringify(obj))
{score: null}score: null__proto__: Object


{"score": NaN}