Creates a sequence that repeats the specified element a fixed number of times.
Type of the repeated element.
Element to repeat.
Number of repetitions to produce.
A sequence containing element repeated count times.
Enumeration is deferred. When count is zero or negative, the resulting sequence is empty.
const repeated = repeat('a', 5).toArray();console.log(repeated); // ['a', 'a', 'a', 'a', 'a'] Copy
const repeated = repeat('a', 5).toArray();console.log(repeated); // ['a', 'a', 'a', 'a', 'a']
Creates a sequence that repeats the specified element a fixed number of times.