List of utility methods to do Array Remove From To
remove(from, to)Array.prototype.remove = function (from, to) { var t = this.slice((to || from) + 1 || this.length); this.length = from < 0 ? this.length + from : from; return this.push.apply(this, t); }; | |
removeElement(from, to)'use strict'; Array.prototype.removeElement = function(from, to) { const rest = this.slice((to || from) + 1 || this.length); this.length = from < 0 ? this.length + from : from; this.push(...rest); return this; |