Tell us what’s happening:
so im at the repeat string basic algorithm scripting challenge and i get the right output with my code but the tests are not passing
Your code so far
function repeatStringNumTimes(str, num) {
let result = []
if(num <= 0){
return ''
} else {
for (let i = 0; i < num; i++){
result.push(str)
}
let end = result.join('')
console.log('"' + end + '"')
}
}
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/83.0.4103.116 Safari/537.36
.
Challenge: Repeat a String Repeat a String
Link to the challenge: