2. JavaScript Variables
JavaScript has variables just like many other programming languages. Variables are also
known as holders or containers. These containers will allow you to position data and then basically
refer to the data by naming the container.
Variables can be known as something that may change. A number defined by a letter is called
a variable in basic algebra. X might be a common name for a variable, but Y, Z, or another name may
describe it just as easily.
There is no value or meaning to x but a value can be added to it.
x = 5;
presently, x reflects 5. Consider x, which is a number, to be a container that stores 5.
In JavaScript, variables work the same, but they will be worth more than just a number. All
kinds of data values can be used, which you will understand by the end of this learning guide.
To declare a new variable in JavaScript we can use the keywords; var, let and const.