Like the title, is there such a method?
某草草2017-05-18 11:03:17
The element is deleted, but the original address is still retained, so the subsequent elements must be moved forward. This will reduce the number of elements and update the length
我想大声告诉你2017-05-18 11:03:17
Will be updated
var tt = [1, 2, 3];
tt.length // 3
tt.splice(0, 1); // [1]
tt.length //2
For your needs, you can write a method yourself and encapsulate splice:
function my_splice(arr, start, length) {
arr.splice(start, length);
return arr.length;
}