Hint
var hoisting: declaration moves to the top, assignment stays. Value is undefined before assignment.
console.log(x);
var x = 5;
console.log(x);undefined 5
Explanation: var declarations are hoisted (moved up) but not their assignments. First log sees the hoisted-but-uninitialized x.
Key Insight: var hoisting: declaration moves to the top, assignment stays. Value is undefined before assignment.