Hacker News new | ask | show | jobs
by zokier 317 days ago
NaN is not part of JSON by any spec. Top level scalar values were disallowed by RFC 4627.
1 comments

Fair enough. I'm not sure how much JSON parsers in the wild care about that spec. I just tried with Python and it was happy to accept scalars and NaN. JavaScript rejected NaN but was happy to accept a scalar. But sure, compliant parsers can disregard those cases.