The code looks as following:
inputArray = [
{ name: 'file1.jpg' },
{ name: 'file1.jpg' },
{ name: 'file2.jpg' },
{ name: 'file3.jpg' },
{ name: 'file4.jpg' }
]
filteringArray = ['file1', 'file2']
const outputArray = inputArray.filter( ? )
I need to filter the inputArrat so that the outputArray should contain only objects, which filenames ('name' property) are in filteringArray.
outputArray = [
{ name: 'file1.jpg' },
{ name: 'file2.jpg' }
]
I've worked so far with simpler filtering conditions, but I'm not sure how to solve this.