Variables are Containers for Storing Data
JavaScript Variables can be declared in 4 ways:
- Automatically
- Using
var
- Using
let
- Using
const
In this first example, x
, y
, and z
are undeclared variables.
They are automatically declared when first used:
Example
x = 5;
y = 6;
z = x + y;