Creates a copy of an object without the given properties: the opposite of pick.
pick
The copy is shallow, so nested objects are shared with the original, which isn't changed.
The object to copy.
The properties to leave out.
The new object.
const user = { id: 1, name: 'Ada', password: 'hunter2' };omit(user, ['password']); // { id: 1, name: 'Ada' } Copy
const user = { id: 1, name: 'Ada', password: 'hunter2' };omit(user, ['password']); // { id: 1, name: 'Ada' }
Creates a copy of an object without the given properties: the opposite of
pick.The copy is shallow, so nested objects are shared with the original, which isn't changed.