Variables & Scope

Hoisting

Declarations are conceptually moved to the top of their scope. Initializers are not.

js
console.log(a); // undefined (var is hoisted)
var a = 1;

console.log(b); // ReferenceError (TDZ)
let b = 1;

Function declarations are hoisted with their body; function expressions are not.

Interview questions

Sign in to save

Are arrow functions hoisted?

The variable binding follows normal `let`/`const`/`var` rules. The arrow function value is only assigned at evaluation time — so no, they aren't callable before their line.