@mysteryhouse/interleave-recursive
v0.1.2
Published
Functions for recursively interleaving arrays
Downloads
28
Readme
Interleave Recursive
interleave-recursive
is a zero-dependency javascript package that provides
functions for recursively interleaving the contents of two or more arrays.
Installing
npm install @mysteryhouse/interleave-recursive
Usage
import { interleave } from "interleave-recursive";
const result = interleave([1, 2, [3, 4]], ["a",["b", "c"]]);
console.log(result);
[
1, 'a', 2, 'b', 3, 'a', 1, 'c',
2, 'a', 4, 'b', 1, 'a', 2, 'c',
3, 'a', 1, 'b', 2, 'a', 4, 'c'
]