Created
January 13, 2022 04:45
-
-
Save ancyrweb/0b45c57d60d48b916a2873d686d16b39 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: 4, | |
}, | |
{ | |
name: "Swain", | |
level: 5, | |
} | |
]; | |
const hasExpectedLevel = (expectedLevel) => (champion) => champion.level >= expectedLevel; | |
const hasUltimate = hasExpectedLevel(6); | |
const oneChampionHasUltimate = champions.some(hasUltimate) // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment