Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxhallinan/flattin
Flatten nested arrays into a new array.
https://github.com/maxhallinan/flattin
Last synced: about 1 month ago
JSON representation
Flatten nested arrays into a new array.
- Host: GitHub
- URL: https://github.com/maxhallinan/flattin
- Owner: maxhallinan
- License: mit
- Created: 2017-02-13T03:22:41.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-01T02:24:37.000Z (over 7 years ago)
- Last Synced: 2024-11-08T18:53:57.081Z (about 2 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# flattin
Flatten arbitrarily nested arrays into a new array.
This implementation avoids `Array` and `Array.prototype` methods, and spread/rest.
Just for fun.## Usage
```js
const flattin = require('flattin');flattin([[1, 2, [3]], 4]);
//=> [1, 2, 3, 4]
```## API
### flattin(array)
#### array
Type: `Array`
The array to flatten.