Created
May 20, 2017 23:26
-
-
Save Lokua/b7cca2506d6118fb97a2f8c8b6bf213a to your computer and use it in GitHub Desktop.
shallow copy of object without provided keys
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
function omit(keys, obj) { | |
return keys.reduce((o, k) => { | |
o[k] = obj[k] | |
return o | |
}, {}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment