Repeat()

Returns a Seq.Indexed of value repeated times times. When times is not defined, returns an infinite Seq of value.

Repeat<T>(value: T, times?: number): Seq.Indexed<T>

Discussion

Note: Repeat is a factory function and not a class, and does not use the new keyword during construction.

const { Repeat } = require('immutable')
Repeat('foo') // [ 'foo', 'foo', 'foo', ... ]
Repeat('bar', 4) // [ 'bar', 'bar', 'bar', 'bar' ]
This documentation is generated from immutable.d.ts. Pull requests and Issues welcome.

© 2014–present, Lee Byron and other contributors
Licensed under the 3-clause BSD License.
https://immutable-js.com/docs/v4.0.0/Repeat()/