Skip to content

mormahr/flatten-deep

Repository files navigation

flatten-deep

npm version Build Status

  • Deep flatten arrays in JavaScript
  • Non-recursive algorithm.
  • Fast (see Benchmarks)
  • Linear or constant memory usage

Usage

$ npm install --save flatten-deep
var flattenDeep = require("flatten-deep");

console.log(flattenDeep([1, [2, [3, [4, 5], 6]]]))
// => [ 1, 2, 3, 4, 5, 6 ]