Tweakr
    Preparing search index...

    Function omit

    • Returns a new object excluding the specified keys.

      Type Parameters

      • T extends object
      • K extends string | number | symbol

      Parameters

      • obj: T

        The source object.

      • keys: K[]

        An array of keys to omit from the object.

      Returns Omit<T, K>

      A new object without the specified keys.

      const obj = { a: 1, b: 2, c: 3 };
      const result = omit(obj, ["b", "c"]);
      console.log(result); // { a: 1 }

      1.1.0