Skip to content

Instantly share code, notes, and snippets.

@senthilmpro
Created October 23, 2019 18:55
Show Gist options
  • Save senthilmpro/09b3035487ad0e42378764c4199cc3ec to your computer and use it in GitHub Desktop.
Save senthilmpro/09b3035487ad0e42378764c4199cc3ec to your computer and use it in GitHub Desktop.
Deep Flatten Array - Javascript
function deepFlatten(arr){
return [].concat.apply([], arr.map(x => Array.isArray(x) ? deepFlatten(x) : x));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment