Skip to main content
Latest
function flatMapDepth
import { flatMapDepth } from "https://deno.land/x/lodash_es@v0.0.2/mod.ts";

This method is like _.flatMap except that it recursively flattens the mapped results up to depth times.

Examples

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

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

Parameters

collection

The collection to iterate over.

iteratee
depth