Programming has drawn me back into math, and I am really enjoying seeing the parallels between the formal logic of mathematics and the logic we see in code.
Both of these methods work on an array of data and take a predicate function as an argument. Array.some checks to see if the predicate is true for any one of the elements in the array. Array.every checks to see if the predicate is true for all of the elements in the array.
In other words, the opposite of saying, “Q(x) is true for every single element in D” would be to say, “There is at least one element in D for which Q(x) is not true.” Formally,