I have an array that contains a bunch of objects:
let sample = [
{
name: 'obj1',
values: ["value1", "value2"]
},
{
name: 'obj2',
values: ["value3", "value4"]
},
{
name: 'obj3',
values: ["value5", "value6"]
}
]
I need to combine all the arrays on the objects to end up with something like this:
let outputArray = ["value1", "value2", "value3", "value4", "value5", "value6"]
Cant seem to find the best way to do this. Thank you.