In: Computer Science
A variable is simply a name of storage location
The data type of a variable determines the kind of data the variable can hold.
commonly used data types : byte,short,int ,long,float,double,char,boolean.
In some programming languages like c,c++, Java
a variable declaration always contains two components: the type of the variable and its name.
Example: int count = 0; here int is data type & count is name of variable.
In some programming languages like java script we omit data type.
A variable in JavaScript can contain any data. A variable can at one moment be a string and at another be a number.
// no error let message = "hello"; message = 123456;
// Screenshot of the code & output