Created
July 29, 2016 08:57
-
-
Save kutyel/492b196a9946e48375bc62a6ce3d8d49 to your computer and use it in GitHub Desktop.
Some useful currying examples!
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 get = prop => obj => obj[prop]; | |
array.map(get('key')); | |
const match = req => obj => Object.keys(req).every(key => Object.keys(obj).includes(key) && obj[key] === req[key]); | |
array.filter(match({'key': value})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment