omit

object

Creates an object composed of properties that are not omitted.

Signature

omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>

Parameters

NameTypeDescription
objTThe source object
keysK[]The property keys to omit

Returns

Omit<T, K> - Returns the new object

Examples

Basic Usage

import { omit } from 'dashlite'

const object = { a: 1, b: 2, c: 3 }
const result = omit(object, ['a', 'c'])
console.log(result)

Output:

{ b: 2 }

Available since version 1.0.0