1//Consider the following example object literal:
2var myObject = {
3 sProp: 'some string value',
4 numProp: 2,
5 bProp: false
6};
7
8//You can use dot syntax to add a new property to it as follows:
9myObject.prop2 = 'data here';
10
11//Modify a Property of an Object Literal
12//The process for modifying a property is essentially the same.
13//Here we will assign a new value to the sProp property shown in the
14//original myObject definition above:
15myObject.sProp = 'A new string value for our original string property';
16
17//Read Current Value of Object Property
18//The following demonstrates how to access a property of an object literal:
19alert(myObject.sProp) // display myObject.sProp value in alert
20var val = myObject.sProp; // assign myObject.sProp to variable