Skip to content
Onsite

Output: outer let x logged inside a block that later declares its own let x

MediumP2Output

What does this code print?

1let x = 'outer';
2console.log('start');
3{
4 console.log(x);
5 let x = 'inner';
6}
Saved automatically

One line per console.log. Arrays as [1, 2, 3], objects as { a: 1 }, an uncaught error as Uncaught TypeError: message (Chrome and Node wording).

Hints

Saved automatically