Tell us what’s happening:
what’s wrong in my code?
i test it and does what it is asked
Your code so far
function repeatStringNumTimes(str, num) {
if(num>0){
for(let n=1; n<=num; n++){
return str;
}
}else{
return "";
}
}
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/75.0.3770.142 Safari/537.36 OPR/62.0.3331.116
.
Link to the challenge: