Skip to content

Instantly share code, notes, and snippets.

@junajan
Created November 12, 2019 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save junajan/182602804c874c673569ccb798887b0a to your computer and use it in GitHub Desktop.
Save junajan/182602804c874c673569ccb798887b0a to your computer and use it in GitHub Desktop.
const arr = [{
values: [1, 2]
}, {
values: [3, 4]
}];
const c = arr
.map((obj) => obj.values)
.reduce(((all, arr) => [...all, ...arr]), []);
console.log(c)
// > [ 1, 2, 3, 4 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment