Skip to content

rradoychev/make-flat-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Package for flattening arrays. Alternative to .flat() Compatible with ES5, ES6.

Make flat array

How to use

Install the component with npm OR yarn:

npm install @x3m/make-flat-array;
OR
yarn add @x3m/make-flat-array;

Import the makeFlatArray into your file:

import { makeFlatArray } from "@x3m/make-flat-array";

You can also require it, or simply add it in <script></script> tag.

Example usage:

makeFlatArray(array, depth);
depth - from 1 to Infinity (if set to Infinity, it will automatically determine how much times it is needed to produce fully flatten array)

makeFlatArray(['1','2',['3','4']], 1);

This package is alternative to the ES2019 .flat()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published