1. Home
  2. Javascript
  3. Try catch
#javascript

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

try {
    // try some code here
} catch(error) {
    console.error(error);
}
copy
Full Javascript cheatsheet
Sitemap Git repository