¿Qué es el Hoisting?
What is hoisting in JavaScript? How does it differ between var, let/const, and function declarations?
Before execution, the JS engine scans for declarations and 'hoists' them: **var**: declaration hoisted AND initialized to undefined. **let/const**: hoisted but NOT initialized → Temporal Dead Zone (TDZ). Accessing before declaration throws ReferenceError. **function declarations**: fully hoisted (name + body). Can be called before the line where they appear. **function expressions**: variable is hoisted (as var/let/const), but the function value is not. ```js console.log(a); // undefined (var hoisted) var a = 5; console.log(b); // ReferenceError (TDZ) let b = 5; greet(); // works! function declaration fully hoisted function greet() { console.log('hi'); } oops(); // TypeError: oops is not a function var oops = function() {}; ```