Skip to content

Instantly share code, notes, and snippets.


Carlos Rene Cerrato Estrada ccerrato147

View GitHub Profile
View flatArray.js
// The nested array
const nested = [[1,2,[3,[8,10]]],4];
// An array that will contain the flatten array
const flat = [];
// The function that runs through the array and flattens it
const scan = (el, arr) =>{
throw "The first parameter should be an array";
throw "The second parameter should be an array";
You can’t perform that action at this time.