Javascript Array addAll(items)

Description

Javascript Array addAll(items)


Array.prototype.addAll = (items) => {
    this.push.apply(this, items);/* www. ja  v  a  2 s.co  m*/

    this.push(null);
    this.pop();
}

Array addAll(others)

Array.prototype.addAll = function(others) {
 var thisArray = this;
 others.foreach(function(e) {
  thisArray.push(e);//from w  w  w. j av  a 2s. c  o m
 });
};



PreviousNext

Related