Created
July 25, 2019 15:55
-
-
Save btorresgil/55b7987cb54eff16a3a667edc50a7c6a to your computer and use it in GitHub Desktop.
JS: Pick object properties, curried - Saved from https://stackoverflow.com/questions/17781472/how-to-get-a-subset-of-a-javascript-objects-properties/32184094#32184094
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 pick = (...props) => o => props.reduce((a, e) => ({ ...a, [e]: o[e] }), {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment