omit
| Generic types: | T K |
Creates a new object without the specified keys Native replacement for lodash omit()
Presentation
function omit (obj: T, keys: K[]): Omit<T, K>;Returns
Omit<T, K> -New object without specified keys
Parameters
| Name | Type | Description |
|---|---|---|
| obj | T | Source object |
| keys | K[] | Keys to omit |
Example usage
const obj = { a: 1, b: 2, c: 3 };
omit (obj, ['b']); // { a: 1, c: 3 }