1. Home
  2. ›
  3. Javascript
  4. ›
  5. 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