Skip to content

Instantly share code, notes, and snippets.

View jonalvarezz's full-sized avatar
🦑

Jonathan Alvarez jonalvarezz

🦑
View GitHub Profile
@jonalvarezz
jonalvarezz / array-flat.js
Created November 15, 2018 03:30
Flatten an array of arbitrarily nested arrays of integers into a flat array of integers
/**
* Array Flat
* This a commonJS module written in ES6 that will flatten
* an array of arbitrarily nested arrays of
* integers into a flat array of integers.
*
* @example
* import arrayFlat from '/your/path/array-flat'
*
* flatten([0, 1, 3, [4, 5, 6, [4, 6]]])