This section includes two parts which are implementing coding task and adding test cases for the solution. During the coding session, we are asking you to implement a function that generates a stats object for the movies array in the format.
getMoviesStatsByGenre(movies, 1972);
const movies = [
{
title: "The Shawshank Redemption",
year: 1994,
director: "Frank Darabont",
duration: "2h 22min",
genre: ["Crime", "Drama"],
rate: 9.3,
},
{
title: "The Godfather",
year: 1972,
director: "Francis Ford Coppola",
duration: "2h 55min",
genre: ["Comedy"],
rate: 9.2,
}
]
./
├── src
│ ├── task1.ts -- Task
│ ├── task1.test.ts -- Test of Task File
└──-── configurations
└──-── README.md