Skip to content

Instantly share code, notes, and snippets.

@EliaECoyote
Created January 27, 2019 13:16
Show Gist options
  • Save EliaECoyote/6e2bc32084387096ae50e45a5489c303 to your computer and use it in GitHub Desktop.
Save EliaECoyote/6e2bc32084387096ae50e45a5489c303 to your computer and use it in GitHub Desktop.
function removeByKey (myObj, deleteKey) {
return Object.keys(myObj)
.filter(key => key !== deleteKey)
.reduce((result, current) => {
result[current] = myObj[current];
return result;
}, {});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment