Skip to content

Instantly share code, notes, and snippets.

@alegut
Created February 21, 2020 07:40
Show Gist options
  • Save alegut/171a8868ab44dc8962ea0c60f82de8e6 to your computer and use it in GitHub Desktop.
Save alegut/171a8868ab44dc8962ea0c60f82de8e6 to your computer and use it in GitHub Desktop.
Flattening an array of arrays
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