1. Home
  2. Javascript
  3. Try catch

Try catch allows to run a block of code and capture any exceptions.

#javascript
try {
    // try some code here
} catch(error) {
    console.error(error);
}
copy
Full Javascript cheatsheet