Tell us what’s happening:
I got every word to double except abc 3 times and abc 4 times. I tried manipulating the loops but every time I do I get less green checks.
Your code so far
function repeatStringNumTimes(str, num) {
// repeat after me
var word = str.split('');
var strings = '';
for(var k = 0; k < word.length; k++){
for(var i = 0; i < num; i++){
strings += word[k];
}
}
return strings;
}
repeatStringNumTimes("abc", 3);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string