JavaScript Variables
1 min read
Variables
Declare variables with let, const or (the older) var.
let name = "Alex";
const PI = 3.14159;
let age = 25;
- Use
constwhen the value won't change. - Use
letwhen it will. - Avoid
varin modern code.