Npm array flatten includes flat, magikflata modules. It Receives multilevel nested array as an input and flattens it into one dimensional.
npm i npm-array-flatten
var arrayFlatten = require('npm-array-flatten');
Receives the nested input array and makes it into single dimensional.
var inputArray = [1,2,3,4,[5,[6,12,21,[1,2,3],5],9],7,8,9];
arrayFlatten.flat(inputArray)
// [1,2,3,4,5,6,12,21,1,2,3,5,9,7,8,9]
Demo @array-flatten | https://tonicdev.com/npm/npm-array-flatten
Krishcdbry [krishcdbry@gmail.com]
MIT @krishcdbry