Created
February 12, 2018 21:59
-
-
Save mazulo/f659e48f17a55a6c2507b5924fc1fda9 to your computer and use it in GitHub Desktop.
Filter an object based in its keys
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
Object.keys(object).filter(function (key) { | |
return key != "key"; | |
}).reduce(function(obj, key) { | |
obj[key] = object[key]; | |
return obj; | |
}, {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment