Function: cycle()
cycle<
Value
>(iterable
):Iterable
<Value
,any
,any
>
Returns an infinite iterable that repeatedly yields the values of iterable
in iteration order.
Type Parameters
• Value
Parameters
• iterable: Iterable
<Value
, any
, any
>
Returns
Iterable
<Value
, any
, any
>
Example
console.log(
pipe(
cycle([`sloth`, `more sloth`]),
take(6),
join(`, `),
),
)
//=> sloth, more sloth, sloth, more sloth, sloth, more sloth