Skip to content

Instantly share code, notes, and snippets.

@HiveSolution
Last active March 31, 2016 11:26
Show Gist options
  • Save HiveSolution/190924889b2f3e53b81d05a4158f0f8b to your computer and use it in GitHub Desktop.
Save HiveSolution/190924889b2f3e53b81d05a4158f0f8b to your computer and use it in GitHub Desktop.
Simple prototype ext. for array to remove elements
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);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment