Created
August 17, 2017 22:53
-
-
Save gitfaf/b3845c83502b7c519e8b8fc37537cd8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function flaten (array) { | |
return array.reduce( (acc, curr) => acc.concat(curr), []); | |
} | |
let aoa = [ | |
[1, 2, 3, 4], | |
[5, 6], | |
[7, 8, 9] | |
]; | |
console.log(flaten(aoa)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment