|
May 6, 2002 Defining Constant Objects and Arrays Tips: May 2002
Yehuda Shiran, Ph.D.
|
|
When a constant variable references a complex data type such as the Object or the Array, only the reference to the data remains constant. The content of the Object or the Array can be changed. It allows you to keep the address of an object or an array fixed, and it also keeps you from deleting the reference to them. You can freely change the content of the object or each one of the array elements, but you cannot change the length of the array or the structure of the object. The following example declares an array of 12 objects of the Object data type (ECMAScript Edition 3):
Anywhere in the application you can assign a value to an element of the array:
To learn more on JScript .NET, go to Column 108, JScript .NET, Part II: Major Features.
People who read this tip also read these tips: Look for similar tips by subject: |