Junior JavaScript

What is try…catch?

Blocks to handle exceptions.

try { JSON.parse("invalid"); } catch(e) { console.error(e); }

More from JavaScript Tutorial

All questions for this course