I have two array one is Movie List and another is Genre
Requirement:
Need to compare both the array and filter the movies according to its genre.
1.Example for Movie List
movietList = [
{
title: "The Dark Knight",
genre: "Action"
},
{
title: "The Godfather",
genre: "Crime"
},
{
title: "The Shawshank Redemption",
genre: "Drama"
},
]
2.Example for Genre
genre = [Action, Crime, Drama]
3.Expected Result
result = [
action: {
title: "The Dark Knight"
},
crime: {
title: "The Godfather"
},
drama: {
title: "The Godfather"
}
]