Before 2015, var was the only way to declare variables:
var oldStyle = "legacy"
You'll see var in older code and tutorials. It works similarly to let but has quirks that cause bugs. The main difference is scope: var ignores block boundaries like if statements, while let respects them.
Use let and const in new code. Understanding var helps you read older codebases.