Last active
March 14, 2017 11:57
-
-
Save daviddarnes/ae9bb46837012c142d4a9bfde67dff8c to your computer and use it in GitHub Desktop.
repeatify test
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
function repeatify(count) { | |
let newString = this; | |
for (var i = 1; i < count; i++) { | |
newString += this; | |
} | |
return newString; | |
} | |
String.prototype.repeatify = repeatify; | |
console.log('hello'.repeatify(3)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment