Skip to content

Instantly share code, notes, and snippets.

@mallowigi
Created May 13, 2014 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mallowigi/8023b1cf35496ef54416 to your computer and use it in GitHub Desktop.
Save mallowigi/8023b1cf35496ef54416 to your computer and use it in GitHub Desktop.
JSON parse polyfill
JSON:
parse: (string) ->
if string[0] != "{" && string[0] != "["
return null
else if window.JSON?
window.JSON.parse(string)
else
eval(string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment