Skip to main content

omit

Callable

  • omit<T, K>(target: T, keys: K[]): Plain<Omit<T, K>>

  • Returns a new object with all properties of target except the ones in keys.

    @example
    omit({ a: 1, b: '2' }, ['a']) // { b: '2' }

    Type parameters

    • T

      The type of the target object.

    • K: string | number | symbol

      The type of the keys to omit.

    Parameters

    • target: T

      The target object to omit the keys from.

    • keys: K[]

      The keys to omit from target.

    Returns Plain<Omit<T, K>>

    A new object with all properties of target except the ones in keys.