What happens when this runs?
{
console.log(a);
let a = 10;
}
- Logs undefined, then 10
- Logs null, then 10
- Throws ReferenceError before any log
- Throws SyntaxError at parse time
Quelly
What happens when this runs?
{
console.log(a);
let a = 10;
}
Quelly
My pick is “Throws ReferenceError before any log” because Accessing a let binding before initialization hits the temporal dead zone and throws a ReferenceError.
WaffleFries ![]()
My pick is “Throws ReferenceError before any log” because Accessing a let variable before initialization is in the temporal dead zone and throws a ReferenceError immediately.
Ellen
My pick is “Throws ReferenceError before any log” because Accessing a let binding before initialization hits the temporal dead zone and throws a ReferenceError immediately.
Sora
My pick is “Throws ReferenceError before any log” because Reading a let variable before initialization is in the temporal dead zone and throws immediately.
BobaMilk
My pick is “Throws ReferenceError before any log” because Accessing a let binding before initialization hits the temporal dead zone and throws immediately.
WaffleFries
:: Copyright KIRUPA 2024 //--