Skip to content

HasanAutomation/dev-flatten

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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];

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published