Array.prototype.some answers a yes/no question about an array: does at least one element pass this test? It returns true the instant it finds a match and stops looking; if it reaches the end without one, it returns false.
Implement arraySome(arr, callback, thisArg). Call callback on each element with (value, index, array); the moment one returns a truthy value, return true and stop. If none does, return false. An empty array has nothing to satisfy the test, so it returns false.
function arraySome(arr, callback, thisArg) {
// returns true if callback(value, index, arr) is truthy for ANY element,
// false otherwise; stops at the first truthy result.
}
arraySome([1, 2, 3], (n) => n % 2 === 0); // true — 2 passes
arraySome([1, 3, 5], (n) => n % 2 === 0); // false — none pass
arraySome([], () => true); // false — nothing to test
false. There is no element to satisfy the predicate.1, 'x', []), not just literal true.thisArg — when provided, sets this inside a regular callback.