5 hands-on exercises and 5 find-the-bug challenges for the JavaScript Error Types lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Report the name when a method is called on null.
Report the name when a variable does not exist.
Report the name when JSON cannot be parsed.
Report the name when a value is out of range.
Report a different message depending on the error type.
The name is a string but instanceof needs the class.
A missing variable is a ReferenceError, not a TypeError.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspaceEvery error is an Error, so that branch catches everything.
typeof reports object for every error.
The message describes the problem; the name gives the type.