Error Handling - patrickcole/learning GitHub Wiki

Error Handling

Optional Catch Binding

  • With ESNext, the exception is no longer required to be stated, if it is not being used:
try {
  throwExampleError();
} catch {
  console.log(`Whoops! Something happened, we are on it!`);
}

Source