1.0.3 • Published 2 years ago

dev-flatten v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

dev-flatten

Convert a nested array into a single array

Installation

# using npm
npm install dev-flatten

# using yarn
yarn add dev-flatten

Usage

# using require
const { flatten } = require('dev-flatten');

# using import
import { flatten } from 'dev-flatten';

Example

const arr = [1, 2, 3, [1, 2], [1, [2, [2, 3]]]];
console.log(flatten(arr));
output = [1, 2, 3, 1, 2, 1, 2, 2, 3];
1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago