following is my solution . The console.log details are correct and as expected but still could not run the test. Am I missing something?
function repeatStringNumTimes(str, num) {
// repeat after me
if (!num) return;
let newStr = [];
for(let i=1; i <= num; i++) {
newStr.push(str);
}
console.log(newStr.join(''));
return newStr;
}
repeatStringNumTimes("abc", 2);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string/