Tip: Click lines to highlight, hold ctrl/cmd to multi-select
repeat (15-Oct @ 01:14)
Syntax Highlighted Code
- String.prototype.repeat = function( num ) {
- return new Array( num + 1 ).join( this );
- }
- 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 ) );