Array.prototype.remove = function(from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
};
let a=[1,2,3,4,6,5]
a.remove(0)
console.log(a)//[2,3,4,6,5]
网友评论