If I have the following array of objects:
const movies = [
{
movieTitle: "The House That Jack Built",
movieGenre: "Thriller",
movieDirector: "Lars Von Trier",
movieStarring: "Matt Dillon, Uma Therman",
},
{
movieTitle: "Mother!",
movieGenre: "Thriller",
movieDirector: "Darren Aronofsky",
movieStarring: "Jennifer Lawrence",
},
{
movieTitle: "Hot Fuzz",
movieGenre: "Comedy",
movieDirector: "Edgar Wright",
movieStarring: "Simon Pegg",
}
]
and the following array:
const filters = ["Jennifer Lawrence", "Comedy"]
How can I create a new array containing only the objects that have a value that's in the filters array (in this case the last 2)?
Thanks!