Array.length is a read-write property.
Saturday, February 16th, 2008I just thought it was a read-only property. I came to know it reading a copy of EAS3.0.
당연히 Read-only일 거라고 생각하고 있었는데, EAS3.0을 보다가 알게 되었네요.
当然read-onlyだと思っていったのに、EAS3.0を読みながら分かった。
length property
length:uint [read-write]Language Version : ActionScript 3.0
Player Version : Flash Player 9A non-negative integer specifying the number of elements in the array. This property is automatically updated when new elements are added to the array. When you assign a value to an array element (for example, my_array[index] = value), if index is a number, and index+1 is greater than the length property, the length property is updated to index+1.
Note: If you assign a value to the length property that is shorter than the existing length, the array will be truncated.
quote from ActionScript 3.0 Language Reference
1 2 3 4 | var arr:Array = new Array(0, 1, 2, 3, 4, 5, 6); trace(arr);// output 0,1,2,3,4,5,6 arr.length = 4; trace(arr);// output 0,1,2,3 |


