I have an array of objects like:
let food = [apple, orange, peach, pear].
Each object looks something like this:
let apple : Fruit = [
name: "Apple",
colors: ["red", "yellow", "green", "orange"]
]
I have another array of strings that the food array should be filtered with:
let avoid = ["red", "yellow"]
I want to create a new array from the food array, with Fruit objects that do not contain any of the colors in the avoid array. So in this case, Apple would not be in the food array because it contains both red and yellow.
Thanks!
Fruitrepresent? A type, a protocol, a typealias? something like is not helpful.appleis a varFruitis a type. :D