Created
February 21, 2020 07:40
-
-
Save alegut/171a8868ab44dc8962ea0c60f82de8e6 to your computer and use it in GitHub Desktop.
Flattening an array of arrays
This file contains hidden or 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
const aoa = [[1,2,3],[4,5,6],[7,8,9]]; | |
const flatteredArr = aoa.reduce((acc,arr) => [...acc , ...arr]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment