Tell us what’s happening:
What does this return do? I don’t get why it is necessary to complete the exercise?
“function repeatStringNumTimes(str, num) {
return num > 0? str + repeatStringNumTimes(str, num-1):”";
}
repeatStringNumTimes(“abc”, 3);
Your code so far
function repeatStringNumTimes(str, num) {
num > 0? str + repeatStringNumTimes(str, num-1):"";
}
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/84.0.4147.125 Safari/537.36
.
Challenge: Repeat a String Repeat a String
Link to the challenge: