QuestenaUn entraînement qui indique quoi revoir ensuite
Question 56

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

  1. false
  2. undefined
  3. trueBonne réponse
  4. It throws a TypeError

Explication

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.

Continuer avec ce test

Commencer l’entraînement
Question 56: What does an empty array return from every when given any… · JavaScript Fundamentals · Questena