I need to compare these 2 arrays to get hex.
const colours = [
{value: 2, hex: "#9EFF9C"},
{value: 4, hex: "#31FF00"},
{value: 6, hex: "#FFFF00"},
];
const users = [
{name: 'John', value: 2},
{name: 'Adam', value: 4},
{name: 'James', value: 6},
];
if(colours.value === users.value) {
// get colours.hex ...
}
I need to pass the hex param in style for example
<h1 style={`${hexColor}`}>{user}</h1>
{user}
}) – Vibhav Apr 10 '21 at 17:36