length属性不是只读的,它可以改变数组的长度
var colors = ["red","blue","green"];
alert(colors.length); //3
colors.length = 2;
alert(colors[2]); //undefined
colors.length = 4;
alert(colors[3]); //undefined
colors[colors.length] = "black"; //党把一个值放在当前数组大小的位置上时,数组长度等于最后一项的索引加1
colors[99] = "black";