I have the following object:
data = [
{
type: "fruit",
basket: ["apple", "pear", "orange"]
},
{
type: "vegetable",
basket: ["carrot", "potato"]
}
];
I wish to search the data for 'potato' and have returned 'vegetable'. I am hoping to use filter or map, but I'm struggling with the syntax. Vanilla javascript please.