Javascript String times(value)

Description

Javascript String times(value)


String.prototype.times = function(value){
  var aux = "";
  for (i = 0; i < value; i++){
    aux += this;/*from  w ww  .j av  a2  s .c  om*/
  }
  return aux;
}
console.log("x".times(5));

Javascript String times(value)

String.prototype.times = function(value){
  var aux = "";
  for (i = 0; i < value; i++){
    aux += this;/*  w  ww  .  j  a va  2  s  .  c  om*/
  }
  return aux;
}



PreviousNext

Related