- Home
- /
- Tutorials
- /
- JavaScript Tutorial
- /
- JavaScript Error Types
JavaScript Errors
JavaScript Error Types
JavaScript has several built-in error types, each describing a different kind of failure.
The type tells you what category of thing went wrong.
Recognising them makes debugging much faster.
Example
Example
javascript
let name;
try {
null.length;
} catch (error) {
name = error.name;
}
console.log(name);The output is TypeError.
The Common Types
TypeError - a value is not the type you tried to use it as.
