Maps an Iterable to a flat representation of the mapped Iterables.
const mapTo = flatMap(x => [1, x]);const result = mapTo([1, 2, 3]);console.log(result); // [1,1,1,2,1,3]
chunk, groupBy, map and zip for similar operations.
an Iterable that emits all elements of all mapped Iterables
the source Iterable value type
the target Iterable value type
Generated using TypeDoc
Maps an Iterable to a flat representation of the mapped Iterables.
Example
See
chunk, groupBy, map and zip for similar operations.
Returns
an Iterable that emits all elements of all mapped Iterables