Var
/vɑːr/ · Noun · Development
Definitions
The original variable declaration keyword in JavaScript, which is function-scoped (not block-scoped) and hoisted to the top of its enclosing function. Largely superseded by let and const in modern JavaScript because var's scoping rules are a notorious source of subtle bugs.
In plain English: The old way to create a variable in JavaScript, now mostly replaced by let and const because it had confusing rules about where the variable was accessible.
Example: "Our linter auto-fixes every var to let or const — there's no good reason to use var in 2024."