Javascript:Resize the Length of an Array
by Mohan[ Edit ] 2012-09-20 22:18:56
Resize the Length of an Array
The length property is a not read only, because you can set values to it. Moreover, you can use it to increase or decrease the size of the array. For example:
var myArray = [1,2,3];
myArray.length // 3
myArray.length = 2; //Delete the last element
myArray.length = 20