I am trying to figure out how to make a simple function that will take 2 arguments and return a new string that will repeat the string a certain amount of times that is described in the 2nd argument.
I would like to have it return hellohellohellohellohello but it is only returning hello once.
example:
This is what I have so far, but it only returns hello once
function repeat (arg1, arg2)
{
var counter = 0
while(counter < arg2)
return arg1
counter++
}
repeat("hello", 5);