Javascript Array deleteElementByIndex(e)

Description

Javascript Array deleteElementByIndex(e)

Array.prototype.deleteElementByIndex = function(e) {

  var end = this.length - 1;
  var temp = this[e];
  this[e] = this[end];/*  w ww .  j  a v  a  2 s  .co  m*/
  this[end] = temp;
  this.pop();

  return this;

}



PreviousNext

Related