Returns an iterable that repeats a given value a given number of times.
Time complexity: O(n)
Space complexity: O(n)
The value to repeat
The number of times to repeat the value
An iterable that repeats value times number of times
value
times
Iterable
[...repeat('a', 3)]; // ['a', 'a', 'a'] Copy
[...repeat('a', 3)]; // ['a', 'a', 'a']
Returns an iterable that repeats a given value a given number of times.
Time complexity: O(n)
Space complexity: O(n)