Skip to content

Instantly share code, notes, and snippets.

@daviddarnes
Last active March 14, 2017 11:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daviddarnes/ae9bb46837012c142d4a9bfde67dff8c to your computer and use it in GitHub Desktop.
Save daviddarnes/ae9bb46837012c142d4a9bfde67dff8c to your computer and use it in GitHub Desktop.
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