fork download
  1. if (true) {
  2. var x = 1;
  3. }
  4. console.log(x);
  5.  
  6. if (true) {
  7. const y = 2;
  8. }
  9. console.log(y); // ReferenceError: y is not defined
Runtime error #stdin #stdout #stderr 0.02s 16952KB
stdin
Standard input is empty
stdout
1
stderr
prog.js:9:1 ReferenceError: y is not defined
Stack:
  @prog.js:9:1