Interview Question

What are variables in JavaScript?

Variables are named bindings; use const when reassignment is not needed.

💡 Concept ✅ Quick Revision ⚡ JavaScript

Answer

A JavaScript variable is a binding between a name and a value. • `let` and `const` create lexical bindings. • `var` creates a variable-scoped binding with older declaration behavior. • A binding can be initialized, read, and—unless constant—assigned another value.

Example

Code
let score = 10;
score = 12;
console.log(score);
Output
12

Quick Revision

Variables are named bindings; use const when reassignment is not needed.