Map each item into an iterator and flatten.
import { pipe } from "yta";import { flatMap, range, toArray } from "yta/sync";pipe( range(4), flatMap((n) => range(n)), toArray(),);// => [0, 0, 1, 0, 1, 2] Copy
import { pipe } from "yta";import { flatMap, range, toArray } from "yta/sync";pipe( range(4), flatMap((n) => range(n)), toArray(),);// => [0, 0, 1, 0, 1, 2]
See also:
The input type
The output type
The mapping function
Map each item into an iterator and flatten.
See also: