• Category

    Create a new function that calls the provided fn and negates the result.

    Time complexity: O(1)

    Space complexity: O(1)

    Type Parameters

    • T extends ((...parameters) => boolean)

    Parameters

    • fn: T

      Function to negate the return value of

    Returns ((...parameters) => boolean)

    The inverted return value of fn

    Higher order

      • (...parameters): boolean
      • Parameters

        • Rest ...parameters: Parameters<T>

        Returns boolean

    Example

    import { nullish } from '@jonahsnider/util';

    const array = [0, null, '', undefined, false];

    array.filter(not(nullish)); // [0, '', false]