Created
November 12, 2019 18:20
-
-
Save junajan/182602804c874c673569ccb798887b0a 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
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