Creates a new object by copying all the keys from the given object, excluding those specified.
The object to copy.
The keys that should not be copied.
A new object without the given keys.
const obj = { a: 1, b: 2, c: 3 }const newObj = omit(obj, ['b', 'c']) // type: { a: number }console.log(newObj) // prints: { a: 1 } Copy
const obj = { a: 1, b: 2, c: 3 }const newObj = omit(obj, ['b', 'c']) // type: { a: number }console.log(newObj) // prints: { a: 1 }
Creates a new object by copying all the keys from the given object, excluding those specified.