Tip: Click lines to highlight, hold ctrl/cmd to multi-select

repeat (15-Oct @ 01:14)

remy

Syntax Highlighted Code

  1. String.prototype.repeat = function( num ) {
  2.     return new Array( num + 1 ).join( this );
  3. }
  4.  
  5. alert( "string to repeat\n".repeat( 4 ) );

Plain Code

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

alert( "string to repeat\n".repeat( 4 ) );

Codedump Run

Permalink: http://codedumper.com/repeat