Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/islamhaqq/flatten
Recursively flatten an array
https://github.com/islamhaqq/flatten
arrays assert flatten javascript node npm recursion
Last synced: 15 days ago
JSON representation
Recursively flatten an array
- Host: GitHub
- URL: https://github.com/islamhaqq/flatten
- Owner: islamhaqq
- Created: 2018-04-03T05:15:24.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-03T08:05:25.000Z (almost 7 years ago)
- Last Synced: 2024-12-15T09:45:26.599Z (about 1 month ago)
- Topics: arrays, assert, flatten, javascript, node, npm, recursion
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@syednashikaman/flatten
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flatten
A helper function that lets you recursively flatten arrays.## How to Use
```javascript
const flatten = require('@syednashikaman/flatten');const nestedArray = [1, [2, 3, [4, 5, [6, 7]]]];
flatten(nestedArray); // [1, 2, 3, 4, 5, 6, 7]
```## How to Install
```sh
$ npm install --save @syednashikaman/flatten
```or
```sh
$ yarn add @syednashikaman/flatten
```