const data = [
{ name: "Table", color: ["green", "red", "blue"], price: 300 },
{ name: "Desk", color: ["white", "yellow", "grey"], price: 300 },
{ name: "Desk", color: ["black", "pink", "green"], price: 500 },
];
Hello, I'm trying to code buy-list in objects, but I met logic problem here because for example, there can be same object (called Desk) but with different array (color) for different price.
How can I grab info about price if my script will meet 2 requirements - it will be Desk, color will be black for example, and result needs to be 500 using .find() function returns 1st object (in this case: { name: "Desk", color: ["white", "yellow", "grey"], price: 300 })
Please help :D Greetings.