splice的问题
var arr = [];
arr[0] = "George"
arr[1] = "John"
arr[2] = "Thomas"
arr[3] = "James"
arr[4] = "Adrew"
arr[5] = "Martin"
document.write(arr.slice(1,4) +"
")
document.write(arr.length);
为什么这个长度输出还是6
视屏中 用数组 ,也用 splice()方法却可以 改变长度,为什么呢
var arr = [];
arr[0] = "George"
arr[1] = "John"
arr[2] = "Thomas"
arr[3] = "James"
arr[4] = "Adrew"
arr[5] = "Martin"
document.write(arr.slice(1,4) +"
")
document.write(arr.length);
为什么这个长度输出还是6
视屏中 用数组 ,也用 splice()方法却可以 改变长度,为什么呢
2015-08-08
举报