Skip to content

Instantly share code, notes, and snippets.

@banjeremy
Created July 7, 2017 18:18
Show Gist options
  • Save banjeremy/f92fb7b078031e3aade60c7ac1b85ed6 to your computer and use it in GitHub Desktop.
Save banjeremy/f92fb7b078031e3aade60c7ac1b85ed6 to your computer and use it in GitHub Desktop.
javascript: repeat character n times
// repeat char n times
function repeat(char, n) {
return Array(n + 1).join(char);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment