Javascript String repeat(repeat)

Description

Javascript String repeat(repeat)


String.prototype.repeat = function(repeat){
  var endString = '';
  for(var i = 0; i<repeat; i+=1){
    endString += this;//w ww  .  j ava  2 s  .c o m
  }
  return endString;
}



PreviousNext

Related