I want to write a method that returns the name field of the person whose color id I entered. How do I do this? For example, when I type 97, the name "Veli" will give to me.
const data = [
{
id: 1,
name: "Ali",
colorList: [
{
id: 99,
color_name: 'yellow',
}
],
},
{
id: 2,
name: "Veli",
colorList: [
{
id: 98,
color_name: 'red',
},
{
id: 97,
color_name: 'blue',
},
]
}
]