Q:

Write a JavaScript program that will return true if the provided predicate function returns false for all elements in a collection, false otherwise

0

Write a JavaScript program that will return true if the provided predicate function returns false for all elements in a collection, false otherwise.

All Answers

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

const none = (arr, fn = Boolean) => !arr.some(fn);
console.log(none([0, 1, 3, 0], x => x == 2));
console.log(none([0, 0, 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