JavaScript for Real

Lesson 5 · zap JavaScript for Real

Modules & Error Handling

Structure code into modules and throw errors worth catching.

Before you start

ES modules give you explicit imports, top-level await, and a single instance per module. Good error handling is the other half: throw Error subclasses carrying enough structured detail that the caller can branch without parsing your message strings.

5 exercises·up to 87 XP·5/5 hearts