Skip to content
/ flatible Public

Iterate recursively on a multi-dimensional array.

Notifications You must be signed in to change notification settings

ecman/flatible

Repository files navigation

flatible

build status codecov Code Climate

Iterate recursively on a multi-dimensional array

Usage

const flatible = require('flatible');
const someArray = [["one", ["two", [3, "FOUR"]]], 5];

for (let someValue of flatible(someArray)) {
  console.log(someValue);
}

Output:

one
two
3
FOUR
5