string, number, Boolean, array, object, Null, Undefined
JavaScript Array
The following code creates an array named cars:
var cars=new Array ();
Cars[0]= "Audi";
Cars[1]= "BMW";
Cars[2]= "Volvo";
or (condensed array):
var cars=new Array ("Audi", "BMW", "Volvo");
or (literal array): instance
var cars=["Audi", "BMW", "Volvo"];
JavaScript Objects
Objects are delimited by curly braces. Within parentheses, the object's properties are defined in the form of name and value pairs (name:value). Properties are separated by commas:
var person={firstname: "Bill", LastName: "Gates", id:5566};
The object (person) in the example above has three properties: FirstName, LastName, and ID.
Spaces and folding lines are irrelevant. Declarations can span multiple lines:
var person={
FirstName: "Bill",
LastName : "Gates",
ID : 5566
};
There are two ways to address an object property: an instance
Name=person.lastname;
name=person["LastName"];
Everything in JavaScript is an object: A string, a number, an array, a date, and so on.