Errors and Error Handling
Learn how to address errors in this course all about JavaScript errors!
StartKey Concepts
Review core concepts you need to learn to master this subject
ReferenceError
MDN JavaScript error documentation
SyntaxError
TypeError
Javascript error stack trace
Javascript documentation
Runtime Error in JavaScript
The throw
Keyword in JavaScript
ReferenceError
ReferenceError
// Example of a ReferenceError in JavaScript
let firstName = "John";
// Here, we get a ReferenceError because lastName has not been declared
console.log(firstName + lastName);
A ReferenceError is a type of error thrown when a variable is used that does not exist.
To prevent this error, all variables should be properly declared beforehand.
Debugging JavaScript Code
Lesson 1 of 2
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory