Siebel eScript Language Reference > Siebel eScript Commands > Array Objects >
The length property returns a number representing the largest index of an array, plus 1.
The number of the largest index of the array, plus 1.
NOTE: This value does not necessarily represent the actual number of elements in an array, because elements do not have to be contiguous.
For example, suppose you had two arrays,
bee, with the following elements:
var ant = new Array; var bee = new Array;
ant = 3 bee = 88
ant = 4 bee = 99
ant = 5
ant = 6
The length property of both ant and bee is equal to 4, even though ant has twice as many actual elements as bee does.
By changing the value of the length property, you can remove array elements. For example, if you change ant.length to 2, ant loses elements after the first two, and the values stored at the other indices are lost. If you set bee.length to 2, then bee consists of two members: bee, with a value of 88, and bee, with an undefined value.