Created
January 13, 2022 04:41
-
-
Save ancyrweb/92f976f1eee4dfcfb571e8a92b30a439 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 champions = [ | |
{ | |
name: "Darius", | |
level: 7, | |
}, | |
{ | |
name: "Katarina", | |
level: 12, | |
}, | |
{ | |
name: "Swain", | |
level: 9, | |
} | |
]; | |
const hasExpectedLevel = (expectedLevel) => (champion) => champion.level >= expectedLevel; | |
const hasUltimate = hasExpectedLevel(6); | |
const chamionsAllHaveUltimate = champions.every(hasUltimate) // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment