I want to iterate an array inside an object and check if it matches one of the criteria. Here is a single object that I want to iterate the genres array and check if one of the criteria matches it. (This is one object, while there are plenty more that can be filtred.)
{
"id": 6,
"title": "Ratatouille",
"year": "2007",
"runtime": "111",
"genres": [
"Animation",
"Comedy",
"Family"
],
"director": "Brad Bird, Jan Pinkava",
"actors": "Patton Oswalt, Ian Holm, Lou Romano, Brian Dennehy",
},
And here is my method until now, but don’t know how to iterate:
const filtredMovies = movies.filter((item) => item.genres === "Family");