Basic Algorithm Scripting: Repeat a String Repeat a String//help

Tell us what’s happening:
Can someone pls give a clue or a piece of advice on how to continue. TY

Your code so far


function repeatStringNumTimes(str, num) {
var newStr = "";
for(var i = 0; i < num; i++){
  newStr+=str
}
return str;
}

repeatStringNumTimes("*", 8);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36.

Challenge: Repeat a String Repeat a String

Link to the challenge:

Pay close attention to what you are returning.

2 Likes

Thank you very much. <3