Last active
April 4, 2021 19:32
-
-
Save mbchoa/7aee34893f3acea2cfb64735835bd4e0 to your computer and use it in GitHub Desktop.
Creates an array of specified size containing copies of element provided.
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
function fill(el, numRepeat) { | |
return [...Array(numRepeat)].map(() => el).join(''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment