Hard

Question 1/54

0

/54

Advanced Closure Scope

What will be logged? function outer() { let x = 10; return function inner() { console.log(x); let x = 20; }; } outer()();

Why This Answer?

Advanced Closure Scope

# Advanced Closure Scope This tests understanding of temporal dead zone and variable shadowing. The inner function declares its own `x` with `let`, creating a temporal dead zone before the declaration. Accessing `x` before its declaration throws a ReferenceError. \`\`\`