Function objFlush

  • Deletes a single key or multiple keys from an object

    Example

    const obj = {
    "foo": true,
    "bar": false,
    "one": 2
    };

    objFlush(obj, 'foo');
    =>
    {
    "bar": false,
    "one": 2
    }

    objFlush(obj, ['foo', 'bar']);
    => {
    "one": 2
    }

    objFlush(obj);
    => {}

    Type Parameters

    • Type extends Record<string | number | symbol, unknown>

    • Key extends string | number | symbol

    Parameters

    • a: Type

      An object

    • Optional keys: Key | Key[]

      The key or an array of keys to remove.

    Returns Partial<Type>

Generated using TypeDoc