0

Using JavaScript some method to tests whether at least one element in the array passes the test

JavaScript
const array = [1, 2, 3, 4, 5];

// checks whether an element is even
const even = (element) => element % 2 === 0;

console.log(array.some(even)); // true

RUN
add comment
Suggest a different solution or add another example