This is my issue, I try to get result of items base on my filter array.
const papaFilter=[
{type:'event', value: ['In Person']},
{type:'city', value: ['Boston', 'Miami', 'New York']}
]
const items = [
{city: 'Boston', type: 'In Person'},
{city: 'New Jersey', type: 'In Person'},
{city:'Boston', type:'Virtual'}
]
const filteredResults = items.filter(el => papaFilter.some(filterEl => el[filterEl.type] === filterEl.value));
I want the first object of my items because papafilter contain Boston and In Person.
I know in my condition filterEl.value is an array of multiple value so this condition doesn't work. Any Ideas?
typein items, if you better takeeventfor it? it would make the search easier.