Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The web console is not a JSON parser. To check if something parses as JSON in the web console you should use JSON.parse, e.g:

  JSON.parse('{ 013: "11" }')
which should produce a syntax error (as already mentioned by siblings to this comment).


Thanks. Yeah, I had mistakenly the believe that JSON is mostly a Javascript hash, not that 'JSON is valid Javascript' which means it's a subset of all possible Javascript hashes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: