Skip to content

Instantly share code, notes, and snippets.

@zombie
Created November 12, 2013 21:02
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 zombie/7438632 to your computer and use it in GitHub Desktop.
Save zombie/7438632 to your computer and use it in GitHub Desktop.
ES6, destructuring assignment, Error instances and JSON.stringify()
let test1 = new Error('ubik', 'testing', 123);
console.log(JSON.stringify(test1));
let test2 = { name, message, fileName, lineNumber } = test1;
console.log(JSON.stringify(test2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment