Last active
October 1, 2017 18:28
-
-
Save juliobetta/d99584e9d7778f3d12f60fd868f4c8d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hasDebutAfter1980 = character => character.debut > 1980; | |
const withEvery = characters.every(hasDebutAfter1980); | |
const withReduce = characters.reduce((accumulator, character) => { | |
if(hasDebutAfter1980(character)) { | |
return true; | |
} | |
return accumulator && hasDebutAfter1980(character); | |
}, false); | |
// true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment