In the following example, I would like to use the "name" variable as a parameter for setting another variable for each value.
const series = [{
name: 'Critical',
color: _.find(palette.criticality, name => name.main)
}, {
name: 'High',
color: _.find(palette.criticality, name => name.main)
}];
I can potentially (and probably should) do this by mapping the values after declaring the array, but would love to know if the above is even possible!