Module

x/lodash_es/mod.ts>flatMap

lodash for deno use
Latest
function flatMap
import { flatMap } from "https://dotland.deno.dev/x/lodash_es@v0.0.2/mod.ts";

Creates a flattened array of values by running each element in collection thru iteratee and flattening the mapped results. The iteratee is invoked with three arguments: (value, index|key, collection).

Examples

function duplicate(n) { return [n, n]; }

_.flatMap([1, 2], duplicate); // => [1, 1, 2, 2]

Parameters

collection

The collection to iterate over.

iteratee