Function omit

  • The opposite of [[pick]];

    this method creates an object composed of the own and inherited enumerable property paths of object that are not omitted.

    Type Parameters

    • T extends unknown

    Parameters

    • object: T
    • Rest ...paths: ArrayPath[]
      Rest

    Returns Partial<T>

    Since

    5.18.0

    Example

    const object = { 'a': 1, 'b': '2', 'c': 3 };
    omit(object, ['a', 'c']);
    // => { 'b': '2' }