Properties can usually be changed, added, and deleted, but some are read only.
The syntax for accessing the property of an object is:
The expression must evaluate to a property name.
The block of code inside of the for...in loop will be executed once for each property.
Looping through the properties of an object:
Adding New Properties
You can add new properties to an existing object by simply giving it a value.
Assume that the person object already exists - you can then give it new properties:
The delete keyword deletes a property from an object:
The delete keyword deletes both the value of the property and the property itself.
After deletion, the property cannot be used before it is added back again.
The delete operator is designed to be used on object properties. It has no effect on variables or functions.
All properties have a name. In addition they also have a value.
The value is one of the property's attributes.
Other attributes are: enumerable, configurable, and writable.
These attributes define how the property can be accessed (is it readable?, is it writable?)
( ECMAScript 5 has methods for both getting and setting all property attributes)
The delete keyword does not delete inherited properties, but if you delete a prototype property, it will affect all objects inherited from the prototype.