Skip to content

a simple array flattening made of a javascript generator

Notifications You must be signed in to change notification settings

davidecavaliere/flatten

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flatten

A very simple generator to flatten an array of any depth.

How to use

const flatten = require('flatten');

const array = [1, [2, [3]], [4]];

const flattened = [...flatten(array)];

// flattened: [1, 2, 3, 4]

About

a simple array flattening made of a javascript generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published