What is a variable in JavaScript? A variable is something that store values or information. The values can be numbers (numeric values), text (strings) or any other information such as dates, boolean values(true/false) and more. These values can change from time to time, that is why the name variable. It is similar to the post boxes in the post office, the contents of the post boxes can change but the post boxes still have the same name or label.
To declare a variable in JavaScript, we can use the keyword var
The basic structure of value assignment in JavaScript is
var variable_name= value
or
variable_name= value