const slides = [
{title: 'one', status: 1, slides: [
{name: 'first', id: 1},
{name: 'second', id: 2},
{name: 'third', id: 3},
{name: 'fourth', id: 4},
]},
{title: 'two', status: 1, slides: [
{name: 'all', id: 1}
]},
]
I have this array with objects inside, and a field of these objects is an array(SLIDES), my goal is to show only the objects that have the NAME field in the SLIDES equal to 'first' and 'all'. I would need to put them in a single array in order to go and do the MAP later.
My goal is to have this:
const slides = [
{title: 'one', status: 1, slides: [
{name: 'first', id: 1},
]},
{title: 'two', status: 1, slides: [
{name: 'all', id: 1}
]},
]
Thanks to anyone who can help me.