@newdash/newdash
Version:
javascript/typescript utility library
23 lines (22 loc) • 564 B
TypeScript
/**
* 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
* @category Function
* @param predicate The predicate to negate.
* @returns Returns the new negated function.
* @example
*
* ```js
* function isEven(n) {
* return n % 2 == 0
* }
*
* filter([1, 2, 3, 4, 5, 6], negate(isEven))
* // => [1, 3, 5]
* ```
*/
export declare function negate(predicate: any): (...args: any[]) => boolean;
export default negate;