Javascript Array insert(element)

Description

Javascript Array insert(element)


Array.prototype.insert = function(element) {
  if (this.indexOf(element) === -1) {
    this.push(element);/*from w ww .java 2  s .  com*/
  }
  return this;
};



PreviousNext

Related