Below is the snippet of code:
var ops = [{
label: 'Primary Colors',
options: [{
label: 'Yellow',
value: 'yellow'
}, {
label: 'Red',
value: 'red'
}, {
label: 'Blue',
value: 'blue'
}],
label: 'Secondary Colors',
options: [{
label: 'Pink',
value: 'yellow'
}, {
label: 'Pink',
value: 'pink'
}, {
label: 'Violet',
value: 'violet'
}]
}
I am looking for a way to extract all values from the 'value' field inside the options array and store them in a variable like this:
values = [yellow, red, blue, yellow, pink, violet]
. Do you have any suggestions on how to achieve this?