Flattens nested array to given depth.
This is part of package extra-array.
This is browserified, minified version of @extra-array/flatten.
It is exported as global variable array_flatten.
CDN: unpkg, jsDelivr.
array;// x: a nested array// dep: maximum depth (-1)// --> flattened
const array = ; var x = 1 2 3 4 5;array;// [1, 2, 3, 4, 5] array;// [1, 2, 3, [4, [5]]] array;// [1, 2, 3, 4, [5]]