A property can have zero or more attributes. The attributes control how the property is accessed both internally from inside the interpreter and externally from your script.
Here is a list of the property attributes defined by the ECMA Script standard:
Attribute | Description |
---|---|
ReadOnly | The property is a read-only value. Scripts will not be allowed to change the value although the value may change from time to time if it is dependant on some host related facility. |
DontEnum | You cannot enumerate this property with a for...in repetition. |
DontDelete | You cannot delete this property. |
Internal | This is an internal property, which you normally won't have any access to. It's likely it would be hidden inside the host-managed objects and inaccessible to your scripts. |
Where properties are ReadOnly, this is flagged in the documentation. Read/write access is assumed to be the default case otherwise.
There is conflicting information in the reference sources regarding the read/write ability of some properties. Some suggest a particular property is ReadOnly and other suggest you can assign a value to it. It may be that you can assign a value to it without the JavaScript interpreter complaining but that any value you assign is ignored.
Prev | Home | Next |
Property accessor | Up | Property name |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |