var is function-scoped and can be redeclared; let is block-scoped and can be reassigned but not redeclared; const is block-scoped and can’t be reassigned after its initial value.
All three declare variables, but they differ in scope (where the variable is accessible) and mutability (whether it can be changed later).
Scoped to the nearest function (not block), and can be redeclared and updated freely. var declarations are also "hoisted" — accessible (as undefined) even before the line they're declared on, which can cause confusing bugs.
Scoped to the nearest block (like inside an if statement or loop), and can be reassigned but not redeclared within the same scope. This tighter scoping generally leads to fewer bugs than var.
Also block-scoped, but cannot be reassigned after its initial value is set. Note that for objects and arrays, const prevents reassigning the variable itself, but doesn't make the object's contents immutable — you can still modify properties inside a const object.
Modern JavaScript style generally recommends using const by default, and let only when a variable genuinely needs to be reassigned — var is now considered outdated for most new code.
Last reviewed: September 2026