delete
删除数组元素
var a = [1,2,3,4,5];
delete a[0];
console.log(a); // [undefined, 2,3,4,5]
用 delete 的区别(in 操作符)
var a = ['x','y','z'];
delete a[1];
1 in a; // false, 1 是 key
var a = ['x','y','z'];
a[1] = undefined;
1 in a; // true
arr.length -= 1; // 出去末尾, arr.length = arr.length - 1;