Nodejs String Time times(value)

Here you can find the source of times(value)

Method Source Code

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

Related

  1. times(amount)
    String.prototype.times = function(amount) {
      var string = []
      while (amount-- > 0)
        string.push(this)
      return string.join(" ")
    String.prototype.blank = function() {
      return !(this.replace(/\s+/g, "").length)
    
  2. times(count)
    String.prototype.times = function(count) {
      return count < 1 ? '' : new Array(count + 1).join(this);
    };
    
  3. times(n)
    String.prototype.times = function(n) {
      var s = '';
      for (var i = 0; i < n; i++) {
        s += this;
      return s;
    };
    
  4. times(value)
    String.prototype.times = function(value){
      var aux = "";
      for (i = 0; i < value; i++){
        aux += this;
      return aux;
    console.log("x".times(5));