Skip to content

Instantly share code, notes, and snippets.

@camelcaseblog
Created July 8, 2019 18:30
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 camelcaseblog/2a27471e24abe923e8e8dd7c5e4ac07b to your computer and use it in GitHub Desktop.
Save camelcaseblog/2a27471e24abe923e8e8dd7c5e4ac07b to your computer and use it in GitHub Desktop.
var e = new Error();
e.name = ‘MyError’;
throw e;
// is equivalent to:
class MyError extends Error {}
throw MyError();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment