Skip to content

Instantly share code, notes, and snippets.

@Lokua
Created May 20, 2017 23:26
Show Gist options
  • Save Lokua/b7cca2506d6118fb97a2f8c8b6bf213a to your computer and use it in GitHub Desktop.
Save Lokua/b7cca2506d6118fb97a2f8c8b6bf213a to your computer and use it in GitHub Desktop.
shallow copy of object without provided keys
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