数组的length属性不是只读的
var color=['red','blue','green']; color.length=2; console.log(color); // ["red", "blue"]