A variable in JavaScript is a box that holds different data in it and this box has a name. A variable can contain different data types. The name is mandatory because it will help to find this box later on. If there is no name it would be hard to find it because boxes can be very similar and you cannot just check everything it contains.
When you declare a variable besides the name you are using special keywords. These keywords give special features to newly created variables which will late be used in specific situations. These features give you more power to control the variables in different ways.
To declare a variable you simply write the special keywords, variable name, equal sign, and the value if there is any. The name is like a location indicator in the memory space which we can retrieve later.
Letβs go through all variable keywords to understand why and how we use them.
JavaScript variable keywords
In JavaScript we have 3 variable keywords var, let,β¦
[gs-fb-comments]