Thursday, 21 January 2016

JavaScript Objects

An object is delimited by curly braces.
Inside the braces the object's properties are defined as name and value pairs (name : value).
The properties are separated by commas:
var person={firstname:"John", lastname:"Doe", id:5566};
You can address the object properties in two ways:

name=person.lastname;
name=person
[“firstname"];

0 comments:

Post a Comment