Skip to content

Instantly share code, notes, and snippets.

@seandaniel
Last active July 31, 2020 13:30
Show Gist options
  • Save seandaniel/53a39267fb220a6a5d39fb4c9ac98373 to your computer and use it in GitHub Desktop.
Save seandaniel/53a39267fb220a6a5d39fb4c9ac98373 to your computer and use it in GitHub Desktop.
1. Return movie names
const movieNames = movies.map((movie) => {
return movie.name;
});
console.log(movieNames);
// [
"Good Will Hunting",
"Parasite",
"The Shawshank Redemption",
"Inglourious Basterds",
"The Grand Budapest Hotel",
"Django Unchained",
"Moneyball"
]
// equivalent to lines 1-3
const movieNames = movies.map(movie => movie.name);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment