Posted By

edektor on 01/10/10


Tagged

javascript js array remove


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

nerdfiles


Array.prototype.remove


 / Published in: JavaScript
 

remove and item or items from array

  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  

You need to login to post a comment.