JavaScript
JavaScript accessed a let or const binding before initialization
JavaScript tried to read a let, const, or class binding while it was still in the temporal dead zone.
JavaScript
JavaScript tried to read a let, const, or class binding while it was still in the temporal dead zone.
Observed message
ReferenceError: can't access lexical declaration 'X' before initialization
Why it happens
How to fix it
Official reference
MDN: ReferenceError: can't access lexical declaration X before initializationRelated errors
Explore more