'Is there a universal selector for the includes method?

Say I have the following code:

const fruits = [
{
    name: "apple",
    color: "red"
},
{
    name: "banana",
    color: "yellow"
},
{
    name: "grapes",
    color: "purple"
}
]

const filteredByColor = fruits.filter(fruit => { return fruit.color.includes(selector) })

Is there something I can put as "selector" that will return everything?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source