Q:

Write a JavaScript program to negates a predicate function

0

Write a JavaScript program to negates a predicate function.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

const negate = func => (...args) => !func(...args);
console.log([1, 2, 3, 4, 5, 6].filter(negate(n => n % 2 === 0)));

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now