package
Make multi-dimensional arrays as flat as a pancake
npm install 1dGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
3.3 kB
Includes dependencies.
npm install 1dconst flatten = require('1d');
flatten( [['a'], 'b', ['c', ['d']]] );
// ['a', 'b', 'c', 'd']OBS: This is a built-in feature from Node.js
11.15.0and up. Check out Array.prototype.flat
Flatten an array into a sweet 1D array
Type: Array
Input array to flatten
Type: Array
Default: []
Initial array.
Note: The inital array is not being flattened
MIT © Terkel Gjervig