Questenaتدريب يوضح لك ما ينبغي مراجعته لاحقًا
السؤال 56

What does an empty array return from every when given any ordinary predicate callback?

  1. false
  2. undefined
  3. trueالإجابة الصحيحة
  4. It throws a TypeError

الشرح

every returns true for an empty array because no tested element violates the predicate, an instance of vacuous truth. Returning false would incorrectly require the array to contain at least one passing element.

تابع هذا الاختبار

بدء التدريب
السؤال 56: What does an empty array return from every when given any… · JavaScript Fundamentals · Questena