Repeat String by number - Node.js String

Node.js examples for String:Repeat

Description

Repeat String by number

Demo Code

String.prototype.repeat = function ( num ) {
  return new Array(num + 1).join(this);
}

Related Tutorials