Skip to content

Latest commit

 

History

History

flatten

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

@arr/flatten

Tiny (139B) & fast utility to recursively flatten an array of arrays!

Install

$ npm install --save @arr/flatten

Usage

import flatten from '@arr/flatten';

flatten(['a', ['b', ['c']], 'd', ['e', [['f']]]]);
//=> ['a', 'b', 'c', 'd', 'e', 'f']

API

flatten(arr)

arr

Type: Array
The array to iterate upon.

License

MIT © Luke Edwards