What is the temporal dead zone (TDZ)?

JavaScript Developer Medium

JavaScript Developer — Medium

What is the temporal dead zone (TDZ)?

Key points

  • TDZ occurs specifically with let and const declarations in block scopes
  • Accessing the variable before its declaration line results in a ReferenceError
  • Helps prevent accidental use of variables before they are properly defined

Ready to go further?

Related questions