categories.location array is filtered like this:
const displayedCategories = categories.filter(
(category) => category.location.indexOf(selectedLocation) >= 0
);
Now its structure is changed like below, there's additional nested values. How can I filter value/label now? category.location.value.indexOf doesn't work. Thanks.
"location" : [
{
"value" : "London",
"label" : "London"
}
]