Loading...
Engaged employer
Flatten Array, Create Emitter
Anonymous
Shortest way to flatten an array I could come up with: function flatten(a) { return Array.isArray(a) ? [].concat(...a.map(flatten)) : a; }
to flatten nested arrays : const flatten = array => { return array.reduce((elem, acc) => { return elem.concat(Array.isArray(acc) ? flatten(acc) : acc); }, []); }
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalised job recommendations and updates by starting your searches.
Get actionable career advice tailored to you by joining more bowls.
Check out your Company Bowl for anonymous work chats.