Question PRG-JS-0069
HardWhat is the output of this program?
var x = 1;
{ var x = 2; }
let y = 1;
{ let y = 2; }
function f() { return typeof z; var z = 5; }
console.log(x, y, f());
- A.
2 1 undefined
- B.
1 1 undefined
- C.
Sign up free to see the answer and a step-by-step explanation.