Javascript Array addRange(arr)

Description

Javascript Array addRange(arr)


Array.prototype.addRange = function (arr) {

  if (!arr || !arr.length) throw 'Empty array';

  for (var i = 0; i < arr.length; i++) {
    this.push(arr[i]);//  w ww .j a v  a 2 s .com
  }

};



PreviousNext

Related