What is JavaScript Variable
In this article, we are reading about “ What is JavaScript Variable “. A JavaScript variable is simply a name of the storage location. There are two types of variables in JavaScript: local variable and global variable. There are some rules while declaring a JavaScript variable (also known as identifiers). The name must start with a letter (a to z or A to Z), underscore( _ ), or dollar( $ ) sign. After the first letter, we can use digits (0 to 9), for example, value1. JavaScript variables are case sensitive, for example x and X are different variables. A real-life analogy We can easily grasp the concept of a “variable” if we imagine it as a “box” for data, with a uniquely-named sticker on it. For instance, the variable message can be imagined as a box labeled “message” with the value “Hello!” in it: We can put any value into the box. Also, we can change it. The value can be changed as many times as needed: 1 2 3 4 let m...