Why is `JSON.parse` not throwing exception? Why is `JSON.parse` not throwing exception? json json

Why is `JSON.parse` not throwing exception?


The functionality has been updated to comply with the JSON specification according to RFC 7159, which says:

A JSON value MUST be an object, array, number, or string, or one of the following three literal names:

false null true

The literal names MUST be lowercase. No other literal names are allowed.

So, JSON.parse("null") returning nil is expected functionality, which you can confirm by checking out the tests for parsing single values.