@ngard/tiny-flatten
v1.0.0
Published
A minimal-weight lodash.flatten equivalent utility
Downloads
2
Readme
tiny-flatten
A minimal-weight utility equivalent to lodash.flatten
. For when every byte counts!
Syntax
flatten(/* array */)
Parameters
array
- An array to flatten
Return
Flattens an array a single level deep.
Example
import { flatten } from '@ngard/tiny-flatten';
const value = flatten([1, [2, 3], [4, [5]]]);
// returns [1, 2, 3, 4, [5]]