@x3m/make-flat-array

1.0.2 • Public • Published

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()

Readme

Keywords

Package Sidebar

Install

npm i @x3m/make-flat-array

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

3 kB

Total Files

5

Last publish

Collaborators

  • rradoychev