Hoisting Lab
Function declarations can run before their line; let and const cannot.
During creation, function declarations are fully hoisted. let and
const are also known early, but they stay in the Temporal Dead Zone
until their declaration runs — reading them first throws a ReferenceError.
Important JavaScript
// Works — the whole function is hoisted
greet();
function greet() {
return "Hello";
}
// Throws ReferenceError — TDZ for let/const
console.log(score);
let score = 10;
console.log(name);
const name = "Ava";