Latest
function flattenDepth
import { flattenDepth } from "https://dotland.deno.dev/x/lodash_es@v0.0.2/src/array.js";

Recursively flatten array up to depth times.

Examples

var array = [1, [2, [3, [4]], 5]];

_.flattenDepth(array, 1); // => [1, 2, [3, [4]], 5]

_.flattenDepth(array, 2); // => [1, 2, 3, [4], 5]

Parameters

array

The array to flatten.

depth