Created
July 7, 2017 18:18
-
-
Save banjeremy/f92fb7b078031e3aade60c7ac1b85ed6 to your computer and use it in GitHub Desktop.
javascript: repeat character n times
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
// 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