- let
- var
- const
Scope of variables and constants
There are several ways to start declaring and using variables and constants. In general the best is to use the let keyword.
examples/basic/variables.js
x = "Joe" var y = "Jane" let z = "George" const w = "nothing" console.log(x) // Joe console.log(y) // Jane console.log(z) // George console.log(w) // nothing