Skip to content

fx-flow v0.7.0 / pipe/strict / toArray

Function: toArray()

toArray<A>(iterable): ArrayReturnValue<A>

Convert iterable/asyncIterable to an array.

Type parameters

A extends UniversalIterable

Parameters

iterable: A

Returns

ArrayReturnValue<A>

Example

typescript
pipe(
  [1, 2, 3, 4, 5],
  map((a) => a + 10),
  filter((a) => a % 2 === 0),
  toArray
) // [12, 14]

More examples

Source

packages/core/src/pipe/strict/toArray.ts:27

Released under the MIT License.