Javascript Array repeat(what, L)

Description

Javascript Array repeat(what, L)

Array.prototype.repeat= function(what, L){
  while(L) {/*  w  w  w .  j a  v a2  s. co m*/
   this.push(what);
   L--;
  }
  return this;
}



PreviousNext

Related