Write a JavaScript function that repeats a given string, N times.
The input comes as 2 arguments:
-
The first argument is a string that will represent the one you need to repeat.
-
The second one is a number will represent the times you need to repeat it.
Examples:
Input:
repeat
5
Output:
repeatrepeatrepeatrepeatrepeat
Input:
magic is real
3
Output:
magic is realmagic is realmagic is real
The output is a big string, containing the given one, repeated N times.