Guided Notes

Errors & Debugging

Error types, try/catch/finally, throwing your own errors, the console, and breakpoints.

Kinds of errors

Slide 1 / 5

When something goes wrong, JavaScript throws an error object with a name and a message:

ErrorCauseExample
SyntaxErrorCode that isn't valid JavaScriptlet x = ;
ReferenceErrorUsing a name that doesn't existconsole.log(totl)
TypeErrorUsing a value the wrong waynull.length
RangeErrorA number outside its allowed rangenew Array(-1)
← Forms, Validation & Storage