Repeat a string repeat a string. What trick do I need to pull this off?

Tell us what’s happening:

Your code so far

function repeatStringNumTimes(str, num) {
  // repeat after me
  return str;

repeatStringNumTimes("abc", 3);

Your browser information:

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

Link to the challenge:

Did you follow the suggested link?

You’ll find a link there to one of the string methods, called ‘repeat’:

Hopefully that helps. Do ask further if you’re still not sure how to use it.

Before trying to write the code, have you tried to write out an algorithm in plain language to make sure you understand what steps your code would need to take in order to meet the challenge requirements? Post your algorithm in written steps and/or pseudo-code if you prefer and we can help guide you in your logic.