Here are two arrays I'm working with:
const issues = [{ id: 'foo', state: { label: 'bar'} }]
const states = [{ label: 'bar' }, { label: 'baz' }]
I'm trying to filter the issue array to only include objects that have a matching state
from the states
array. Can someone help me with the correct approach?
This is what I tried, but it's not producing the desired result:
return issues.filter(issue => {
return states.includes(issue.state)
})