Options
All
  • Public
  • Public/Protected
  • All
Menu

Module negate

Index

References

Functions Function

References

Renames and re-exports negate

Function Functions

  • negate(predicate: any): (...args: any[]) => boolean
  • Creates a function that negates the result of the predicate func. The func predicate is invoked with the this binding and arguments of the created function.

    since

    5.13.0

    example
    function isEven(n) {
    return n % 2 == 0
    }

    filter([1, 2, 3, 4, 5, 6], negate(isEven))
    // => [1, 3, 5]

    Parameters

    • predicate: any

      The predicate to negate.

    Returns (...args: any[]) => boolean

    Returns the new negated function.

      • (...args: any[]): boolean
      • Parameters

        • Rest ...args: any[]

        Returns boolean