plain-array

Quickly flattens a deeply nested array without using functional recursion.

Usage no npm install needed!

<script type="module">
  import plainArray from 'https://cdn.skypack.dev/plain-array';
</script>

README

plain-array

Quickly flattens a deeply nested array without using functional recursion.

npm install plain-array

Example

import flatten from 'plain-array';

const array = [0, [1], [2, [3, [4, [5]]], 6], [[7]]];

flatten(array); // => [0, 1, 2, 3, 4, 5, 6, 7]