http://www.w3school.com.cn/jsref/jsref_slice_array.aspend 可选。规定从何处结束选取。该参数是数组片断结束处的数组下标。var arr = new Array(6)arr[0] = "George"arr[1] = "John"arr[2] = "Thomas"arr[3] = "James"arr[4] = "Adrew"arr[5] = "Martin"console.log(arr) //["George", "John", "Thomas", "James", "Adrew", "Martin"] console.log(arr.slice(2,4)) //["Thomas", "James"] James是第四个,但下标是3console.log(arr) //["George", "John", "Thomas", "James", "Adrew", "Martin"] 当然,还有一种理解就是 2 <= x < 4不知道我的理解对不对,还是钻牛角了
添加回答
举报
0/150
提交
取消