Skip to content

Instantly share code, notes, and snippets.

@lon-io
Created June 18, 2017 18:55
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 lon-io/b10d0525ce086cb35f0a957f72c86a67 to your computer and use it in GitHub Desktop.
Save lon-io/b10d0525ce086cb35f0a957f72c86a67 to your computer and use it in GitHub Desktop.
Strip the quotes("") off the keys in a JSON Object
let jsonObj = {
"name": "Lon",
"email": "lon@lon.com"
};
console.log(JSON.stringify(jsonObj).replace(/(")(\w*)(")(:)/g, '$2$4'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment