Home HTML CSS JAVASCRIPT BOOTSTRAP Python Docker ML tutorial About us Privacy policy

Variables


Variables

Variables are just like a container only,it use to hold the data basically.Variables are mandatory because it provides identity to the data,without variables we can't hold the values and access the data particularly. In java Script we can declare variables either by using var keyword or let keyword it's depends on the programmer according to the requirement.

Syntax: Var variable-name;
 Example:  var x;

After declare the variable we provide the value to the variables by using assignment
operator as follows;

 x=10;

We can do both (create a variable and assign a value) simultaneously as well;

 var x=10;

We can also change the value of a variable according to our requirement.

 x=20;



Screenshot-from-2020-02-14-10-59-31


More Topics