Skip to content

Instantly share code, notes, and snippets.

@bignimbus
Created July 5, 2018 20:59
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 bignimbus/c3fb94ad39ede9b6e871d6ff1a34b816 to your computer and use it in GitHub Desktop.
Save bignimbus/c3fb94ad39ede9b6e871d6ff1a34b816 to your computer and use it in GitHub Desktop.
throw 'foo';
// throws an exception of type String and value "foo"
throw new Error('foo');
// throws an exception of type Error with message "foo"
foo();
// throws an exception of type ReferenceError (extends Error)
// with message "foo is not defined"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment