Closures & Functions
Predicate Negation Utility
easyJS SpecificJS / TS3 tests
Problem Statement
Implement `negate(predicate)`, which returns a function that negates the result of the given predicate function.
Examples
Example 1: const isEven = (n) => n % 2 === 0; const isOdd = negate(isEven); [1, 2, 3, 4].filter(isOdd); // [1, 3]
JavaScript & TypeScript starter code included
Run this as a live interviewPractice solo
3 test cases. No second person needed.