Created
August 25, 2010 15:47
-
-
Save jimfleming/549750 to your computer and use it in GitHub Desktop.
repeats a given string x times (source: stackoverflow)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.repeat = function(times) { | |
return new Array(isNaN(times) ? 1 : ++times).join(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment