What happens when you access a variable in the Temporal Dead Zone (TDZ)?

JavaScript Developer Hard

JavaScript Developer — Hard

What happens when you access a variable in the Temporal Dead Zone (TDZ)?

Key points

  • Variables in the TDZ are hoisted but not initialized
  • Accessing them before declaration results in a ReferenceError
  • This behavior is specific to let/const declarations in JavaScript

Ready to go further?

Related questions