Skip to content

Instantly share code, notes, and snippets.

function flattenArray(array){
var newArray=[]
var stillHasNested=false;
array.forEach((item,i)=>{
if(item instanceof Array)
{
item.map(child=>{
newArray.push(child)
if(child instanceof Array)
{