JavaScript has dynamic types. This means that the same variable can be used as different types:
var x; // Now x is undefined
var x = 5; // Now x is a Number
var x = "John"; // Now x is a String
var x = true; // Now x is a Boolean
However Javascript Array and Object does not apply to the above rule which are descried blow.
Arrays
var cars=new Array();
cars[0]="BMW";
cars[1]="Merc";
or
var cars=new Array("BMW","Merc");
Objects
var person={firstname:"Salil", lastname:"Agrawal"};