Skip to content

Instantly share code, notes, and snippets.

@sznowicki
Created May 15, 2017 21:52
Show Gist options
  • Save sznowicki/9b3a88efefdb6f899629999e9c9c7457 to your computer and use it in GitHub Desktop.
Save sznowicki/9b3a88efefdb6f899629999e9c9c7457 to your computer and use it in GitHub Desktop.
class CustomError {
get name() {
return 'foo';
}
get code() {
return 400;
}
test() {
console.log(this.constructor.code);
console.log(this.code);
}
}
const c = new CustomError();
c.test();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment