Skip to content

Instantly share code, notes, and snippets.

@seandaniel
Last active July 31, 2020 13:31
Show Gist options
  • Save seandaniel/bdd4d653eab89d4adba32dcf28cb9ab8 to your computer and use it in GitHub Desktop.
Save seandaniel/bdd4d653eab89d4adba32dcf28cb9ab8 to your computer and use it in GitHub Desktop.
2. Return movies directed by Quentin Tarantino
const quentinTarantinoMovies = movies.filter((movie) => {
return movie.director === 'Quentin Tarantino';
});
console.log(quentinTarantinoMovies)
// [
{
name: "Inglourious Basterds",
releaseDate: 2009,
genre: ['Adventure', 'Drama', 'War'],
rating: 8.3,
director: 'Quentin Tarantino'
},
{
name: "Django Unchained",
releaseDate: 2012,
genre: ['Drama', 'Western'],
rating: 8.4,
director: 'Quentin Tarantino'
},
];
// equivalent to lines 1-3
const quentinTarantinoMovies = movies.filter(movie => movie.director === 'Quentin Tarantino');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment