array-flattener

Write a function that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] → [1,2,3,4]. If the language you're using has a function to flatten arrays, you should pretend it doesn't exist.

Development

clone this repo

npm install

npm test

Usage

import flatten from './array-flattener'

flatten([[1,2,[3]],4])