*Repeat a String n Times
I created this basic code which is working on VS, but running the FreeCodeCamp Test doesn’t, please can someone give me a feedback.
**Your code so far**
function repeatStringNumTimes(str, num) {
let newStr = ' ';
if(num > 0){
for(let x = 0; x < num; x++){
newStr = newStr + str;
}
}
return newStr;
}
repeatStringNumTimes("abc", 3);
**Your browser information:**
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36