Skip to content

Instantly share code, notes, and snippets.

@daviddarnes daviddarnes/repeatify.js
Last active Mar 14, 2017

Embed
What would you like to do?
repeatify test
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
You can’t perform that action at this time.