Function objDelete

  • Deletes a property from an object and returns the modified object.

    Type Parameters

    • K extends ObjectKey

      The type of the keys in the object.

    • V

    Parameters

    • obj: Record<K, V>

      The object from which to delete the property.

    • key: K

      The key of the property to delete.

    Returns Omit<Record<K, V>, K>

    The modified object with the key deleted.

    Example

    const obj = { name: 'John', age: 30 };
    objDelete(obj, 'age');
    //=> { name: 'John' }

Generated using TypeDoc