Temporal Dead Zone
By xyz on 2 weeks ago|0 comment||
0
A temporal dead zone (TDZ) is the area of a block where a variable is inaccessible until the moment the computer completely initializes it with a value.
Suppose you attempt to access a variable before its complete initialization. In such a case, JavaScript will throw a ReferenceError.
console.log(varNumber); // undefined
console.log(letNumber); // it throws a ReferenceError letNumber is not defined
var varNumber = 1;
let letNumber = 1;
Add a Comment
Comments
Comments MIA, jokes needed ASAP. Add yours! 😄