Created
July 31, 2015 09:39
-
-
Save JavaScript-Packer/0d006083a13919b075c2 to your computer and use it in GitHub Desktop.
Repeat a string x times, choose the number of repeated times...
This file contains hidden or 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 repeat(e,r) { | |
| return Array(r + 1).join(e); | |
| } | |
| //alert(repeat("WHAK.com!\n", 4)); |
Author
Author
Hack it down some more if you do not need a function:
alert(Array(4+1).join("WHAK.com\n"))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use it without a function name: