Temporal Dead Zone (TDZ) and Hoisting in JavaScript – Explained with Examples
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. Initialization occurs when you assign an initial value to a variable. To prevent JavaScript from throwing such an error, you’ve got to remember to access your variables from outside the TDZ.