Does anyone have an explanation for this peculiar behavior I encountered while using the JSON.parse() function in Javascript?
Normally, when you pass a string to it, it should generate an error.
For example,
JSON.parse("5ffc58ed1662010012d45b30");
results in:
VM230:1 Uncaught SyntaxError: Unexpected token f in JSON at position 1
at JSON.parse (<anonymous>)
at <anonymous>:1:6
... BUT!!
However, when I used this specific value:
JSON.parse("60000528880e130012727947");
It returns Infinity
??? Why??? How is this even possible? What makes this particular string so special?
Could it be because the string
contains only numbers and an e
in the middle, causing JSON.parse
to interpret it as a kind of float?