Javascript Array delete_at(from, to)

Description

Javascript Array delete_at(from, to)


Array.prototype.delete_at = 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);
}



PreviousNext

Related