Posted By


edektor on 01/10/10

Statistics


Viewed 421 times
Favorited by 0 user(s)

Array.prototype.remove


/ Published in: JavaScript
Save to your folder(s)

remove and item or items from array


Copy this code and paste it in your HTML
  1. Array.prototype.remove = function(from, to) {
  2. var rest = this.slice((to || from) + 1 || this.length);
  3. this.length = from < 0 ? this.length + from : from;
  4. return this.push.apply(this, rest);
  5. };

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.