Skip to content

Instantly share code, notes, and snippets.

@juliobetta
Last active October 7, 2017 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juliobetta/e6fe32134a0c858a89f6ca722d8ce49f to your computer and use it in GitHub Desktop.
Save juliobetta/e6fe32134a0c858a89f6ca722d8ce49f to your computer and use it in GitHub Desktop.
const hasDebutIn90s = character => character.debut >= 1990;
const getName = character => character.name;
console.log(characters.filter(hasDebutIn90s).map(getName));
// [
// "Captain Falcon",
// "Fox",
// "Kirby"
// ]
console.log(characters.some(hasDebutIn90s));
// true
console.log(characters.every(hasDebutIn90s));
// false
console.log(
getName(
characters.find(hasDebutIn90s)
)
);
// "Captain Falcon"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment