Skip to main content

Variable: repeat()

const repeat: <Value>(value) => Iterable<Value>

Defined in: generators.d.ts:289

Returns an infinite iterable that repeatedly yields value.

Type Parameters

Value

Value

Parameters

value

Value

Returns

Iterable<Value>

Example

import { join, pipe, repeat, take } from 'lfi'

console.log(
pipe(
repeat(`sloth`),
take(4),
join(`, `),
),
)
//=> sloth, sloth, sloth, sloth
Playground

Since

v0.0.1