|
Last change
on this file since ba17441 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
531 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Creates a function that negates the result of the predicate function.
|
|---|
| 3 | *
|
|---|
| 4 | * @template T - The type of the arguments array.
|
|---|
| 5 | * @param {(...args: T) => boolean} predicate - The predicate to negate.
|
|---|
| 6 | * @returns {(...args: T) => boolean} The new negated function.
|
|---|
| 7 | *
|
|---|
| 8 | * @example
|
|---|
| 9 | * function isEven(n) {
|
|---|
| 10 | * return n % 2 == 0;
|
|---|
| 11 | * }
|
|---|
| 12 | *
|
|---|
| 13 | * filter([1, 2, 3, 4, 5, 6], negate(isEven));
|
|---|
| 14 | * // => [1, 3, 5]
|
|---|
| 15 | */
|
|---|
| 16 | declare function negate<T extends any[]>(predicate: (...args: T) => boolean): (...args: T) => boolean;
|
|---|
| 17 |
|
|---|
| 18 | export { negate };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.