Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```