Whenever you pass in null
to JSON.parse
:
console.log(JSON.parse(null))
It returns null, but I can't find any docs on why this is the case. Is there a reason why this returns null?
Other things to note:
- This may be due to type conversion, as passing
JSON.parse("null")
also returns null, but is this specified anywhere?