Variables
Variables store data values. JavaScript provides clear rules for declaring and updating variables.
- let — block-scoped variable
- const — constant binding
- var — function-scoped (legacy)
let name = "Sturdee";
const year = 2026;
var legacy = true;
console.log(name, year);Try it Yourself