Created
August 28, 2013 19:52
-
-
Save voxtex/6370444 to your computer and use it in GitHub Desktop.
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(count) { | |
if (count < 1) return ''; | |
var result = '', pattern = this.valueOf(); | |
while (count > 0) { | |
if (count & 1) result += pattern; | |
count >>= 1, pattern += pattern; | |
} | |
return result; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment