var x = 1; if (x === 1) { var x = 2; console.log(x); // Expected output: 2 } console.log(x); // Expected output: 2