@sensimods/utility-lab
    Preparing search index...

    Function omit

    • Creates a new object with the specified keys removed.

      Type Parameters

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

      Parameters

      • obj: T

        The original object to omit keys from.

      • keys: K[]

        An array of keys to omit from the original object.

      Returns Omit<T, K>

      A new object with the specified keys omitted.

      const user = { id: 1, name: 'John', password: '123' };
      const publicUser = omit(user, ['password']); // { id: 1, name: 'John' }