Tag view

#scope

Cross-subject tag search for related interview cards.

Clear

Results update as you type. Press / to jump straight into search.

Tagged with scope

3 cards

JavaScript Easy Theory

Variables in JavaScript: var, let, const, scope rules, hoisting, and the temporal dead zone

Use `let` and `const` for block scope, remember that `var` is function-scoped, and know that hoisting behaves differently across them.

  • `var` is function-scoped
  • `let` and `const` are block-scoped
  • TDZ applies before `let` and `const` initialization

Variables in JavaScript: var, let, const, scope rules, hoisting, and the temporal dead zone