JavaScript variables

Variable is a user given name to a memory location where user can store values and can access it using variable name.
user can give any valid variable name to store data.
Variables can store different types of data like integer,character,string, boolean,real values etc.

Syntax

for all kind of variable we use var keyword then name of variable.

Declaration

After declaring variables we can assign value in variable

Assignment

lets consider above variable to display in program

Example

Java Script Variables

RunInitialization
At the time of declaration variable can also be initialized.

Run