You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
every acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns true. (It is vacuously true that all elements of the empty set satisfy any given condition.)
if there are no elements to satisfy the condition.
"Everything satisfies X" does not require "something that satisfies X" to exist. If it helps, understand it as "nothing falsifies X".
MDN URL
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every
What specific section or headline is this issue about?
Array.prototype.every()
What information was incorrect, unhelpful, or incomplete?
When array is empty the check returns true for any condition
What did you expect to see?
I would expect a false if there are no elements to satisfy the condition.
Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
MDN metadata
Page report details
en-us/web/javascript/reference/global_objects/array/every
The text was updated successfully, but these errors were encountered: