Skip to content

Instantly share code, notes, and snippets.

View pdcoutinho's full-sized avatar

Pedro Coutinho pdcoutinho

  • TheCodeCreators
  • Carcavelos
View GitHub Profile
@pdcoutinho
pdcoutinho / README.md
Created May 16, 2019 00:39 — forked from fibo/README.md
Flatten an array of arbitrarily nested arrays of values into a flat array of values. e.g. [[1,2,[3]],4] -> [1,2,3,4].

flattenArray

Flatten an array of arbitrarily nested arrays of values into a flat array of values

Usage

// Both CommonJS and ES6 import syntaxes are supported
// import flattenArray from './flattenArray'
const flattenArray = require('./flattenArray')