Skip to content

Instantly share code, notes, and snippets.

@alekstar79
Created October 16, 2023 16:08
Show Gist options
  • Save alekstar79/c170d8a5d111f7dd4b990f9db870b0a1 to your computer and use it in GitHub Desktop.
Save alekstar79/c170d8a5d111f7dd4b990f9db870b0a1 to your computer and use it in GitHub Desktop.
function omit(obj, keys) {
return Object.keys(obj)
.filter(key => !keys.includes(key))
.reduce((acc, 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