Created
October 16, 2023 16:06
-
-
Save alekstar79/232d92d9dfbe6fea0462ef7496d0769b to your computer and use it in GitHub Desktop.
This file contains 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
function pick(obj, keys) { | |
return keys.reduce((acc, key) => { | |
if (obj.hasOwnProperty(key)) { | |
acc[key] = obj[key] | |
} | |
return acc | |
}, {}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment