Java script,variables,Variable declaration,Global variables and local variables
 A variable in javascript is a name given for a container or data type which holds data.
Just like other programming languages javascript supports global variables as well as local variables.

Variable declaration:

   var variable-name=value;
           (or)
   variable-name=value;
Note: var keyword is optional in javascript. Note: Javascript is a loosely typed language since it allows variable creation without using underlying data type.
Ex: v=100; // declaring variable without specifying data type.
Ex: var v=100; // declaring variable using var key word and without using data type.
In C# and Java programming languages we must use data type for declaring variables as shown below.
 int x=100;
Hence C# and Java languages are called as strongly typed languages and Javascript called as loosely typed language.Hence the following syntax will not work in javascript.
int x=100;

Global variables and local variables:

<script language="javascript" type="text/javascript">
   var v1=100; // this is a global variable
   function myFunction(var v2) {
    var v3=200;
    v3=v2+v1;
   //v2 and v3 are local variables
     }
</script>