Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JavaScript flatten an array of arrays
let arrays = [ [1,2], [2,3], [3,4] ];
let singleArray = [].concat.apply([], arrays);
//singleArray = [1, 2, 2, 3, 3, 4];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment