• Returns the array that removes the given element

    Type Parameters

    • E

    Parameters

    • Optionalarray: null | E[]

      the arrays to inspect

    • Optionalelement: null | E

      the element to remove

    Returns E[] | undefined | null

    the array that removes the given element

    remove(undefined, 'bar');    // undefined
    remove(['foo', 'bar'], undefined); // ['foo', 'bar']
    remove(['foo', 'bar'], 'bar'); // ['foo']