Feedback for repeat a string repeat a string "solved"

Feedback for repeat a string repeat a string "solved"
0

#1
  function repeatStringNumTimes(str, num) {
  empty = "boo";//boo to test function with neg int
  if(num < 0){
    console.log(empty);
}else{
    string = str.repeat(num);
  console.log(string);
    }
}`

The above code works for the algorithm when tested with every case in the chrome console yes fails in the FCC console.
coments? I have used console.log instead of return statements and boo instead of an empty string for the sake of this post!


#2

Ok so I feel like a moron this does in fact pass all test in the fcc console…How can I delete this topic?


#4

Thanks @P1xt greatly appreciated!