/ Published in: JavaScript
remove and item or items from array
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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); };