Skip to content

Instantly share code, notes, and snippets.

@mazulo
Created February 12, 2018 21:59
Show Gist options
  • Save mazulo/f659e48f17a55a6c2507b5924fc1fda9 to your computer and use it in GitHub Desktop.
Save mazulo/f659e48f17a55a6c2507b5924fc1fda9 to your computer and use it in GitHub Desktop.
Filter an object based in its keys
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