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

  • برمجة جافاسكربت java script
  • برمجة

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

الأجوبة

const none = (arr, fn = Boolean) => !arr.some(fn);
console.log(none([0, 1, 3, 0], x => x == 2));
console.log(none([0, 0, 0]));
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...