Created
May 12, 2018 15:57
-
-
Save CodingBobby/ce10e7bbbda20edcf4a27c8a61ae796e to your computer and use it in GitHub Desktop.
returns string of given length from a given char
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 makeString(len,cha) { | |
let str = ""; | |
for(var i=0; i<len;i++) | |
str += cha; | |
return str; | |
} | |
// example: | |
// makeString(3, "foo") === "foofoofoo" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment