QuestenaPractice that shows what to review next
Question 56

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

  1. false
  2. undefined
  3. trueCorrect answer
  4. It throws a TypeError

Explanation

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.

Continue with this test

Start practice
Question 56: What does an empty array return from every when given any… · JavaScript Fundamentals · Questena