Skip to content
skillbld
Day 12 of 14 30 mintry / catchthrowimport / export

Handle failures gracefully with try, catch and finally, throw your own errors with useful messages, and split a growing program into modules that import and export what they need.

By the end of today you can

  • Read an error message and stack trace
  • Catch errors with try, catch and finally
  • Throw your own errors, including custom error classes
  • Decide where errors should be handled
  • Split code into ES modules with export and import

What's inside

  • 4 sections
  • 3 diagrams and mind maps
  • 3 code examples you can run
  • 5-question quiz
  1. 1Reading an error
  2. 2try, catch and finally
  3. 3Throwing useful errors
  4. 4Modules: splitting code into files

Sign in free to read this lesson

Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.

Sign in free
Day 12: Errors & Modules · JavaScript · SkillBld