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