What is a Temporal Dead Zone?
Answers (1)
Add AnswerVariables declared with the let and const keywords exhibit Temporal Dead Zone behaviour.
It occurs when we attempt to access a variable before it has been initialized.
The following are some examples of temporal dead zones:
x = 23; // Gives reference error let x; function anotherRandomFunc(){ message = "Hello"; // Throws a reference error let message; } anotherRandomFunc();