javascript some vs any code example
Example 1: javascript array some
let array = [1, 2, 3, 4, 5];
//Is any element even?
array.some(function(x) {
return x % 2 == 0;
}); // true
Example 2: array javascript some vs every
// Array.prototype.some = at least one element passes the test
// Array.prototype.every = all elements pass the test