I have an array of objects like this:
[{_colorIndex: 0,name: "ATV Sport"},{_colorIndex: 1,name: "Sport"}]
Id like to loop through that array and replace each _colorIndex value with a value from an array of colors in order. Array:
["#0E5B7E", "#A871A8"]
result:
[{_colorIndex: "#0E5B7E",name: "ATV Sport"},{_colorIndex: "#A871A8",name: "Sport"}]
What would be the best way to do this?