How do let, const and var differ?
Answer out loud or in your head first, then compare.
Answer
let lets you assign a different value to the variable later. const prevents reassigning that variable. Both declarations have block scope, e.g. the inside of an if. The older var has function scope and different rules for access before its declaration, which makes unexpected behaviour easier.
const doesn't make the whole object immutable. With const user = {name: 'Ala'} I can change user.name, although I can't assign a completely different object to user. Day to day I choose const when I don't need reassignment and let when I do.
Why it matters: A simple language question can come up even in a senior interview.
Possible follow-ups: Why doesn't const freeze the contents of an array?
How did it go? Be honest — “Not yet” puts the question on your review list.
Related questions
- Differences between let, const and var? — JavaScript
Further reading
- MDN: Closures(opens in a new tab)Accessed 22.10.2026. Closures and a function's access to its surrounding scope.