Key Concepts

Review core concepts you need to learn to master this subject

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

Pro Logo