Hint
Declarations are moved to top of scope before execution
Hoisting moves declarations to the top of their scope during compilation — before execution. Initializations are NOT hoisted.
console.log(a); // undefined (not ReferenceError)
var a = 5;
greet(); // Works! Function declarations fully hoisted
function greet() { console.log('hello'); }
sayHi(); // TypeError
var sayHi = () => console.log('hi');
let/const are hoisted but live in a Temporal Dead Zone — accessing them before declaration throws a ReferenceError.