Created
July 18, 2019 17:45
-
-
Save chalu/d0ab24b09d6e807ae0cf4accd9e79aac 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 is = (target) => (value) => value === target; | |
| const isOver = (target) => (value) => value > target; | |
| const isOrOver = (target) => (value) => value >= target; | |
| // match devs over 24 years old | |
| const olderThan24 = match('age', isOver(24)); | |
| const over24s = olderThan24(data); | |
| // match devs at, or over 35 years old | |
| const aged35OrOlder = match('age', isOrOver(35)); | |
| const over35s = aged35OrOlder(data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment