Guided Notes
Errors & Debugging
Error types, try/catch/finally, throwing your own errors, the console, and breakpoints.
Kinds of errors
Slide 1 / 5When something goes wrong, JavaScript throws an error object with a name and a message:
| Error | Cause | Example |
|---|---|---|
| SyntaxError | Code that isn't valid JavaScript | let x = ; |
| ReferenceError | Using a name that doesn't exist | console.log(totl) |
| TypeError | Using a value the wrong way | null.length |
| RangeError | A number outside its allowed range | new Array(-1) |
