Skip to main content
variable deepFlatten
import { deepFlatten } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

Deep flattens an array.

Use recursion.[polyfill for Array.prototype.flat] Use Array.prototype.concat() with an empty array ([]) and the spread operator (...) to flatten an array. Recursively flatten each element that is an array.

type

(arr: any[]) => any[]