What is the use of Array.some() method in JavaScript?
Usage:
The JavaScript Array some() method is used to check if any elements in an array pass a test provided by a specified function.
Example:
function isEvenNumber( element ){
return element % 2 == 0;
}
let arr1 = [ 121, 1331, 242, 535, 747 ];
let arr2 = [ 7, 5, 9, 11, 13 ];
let value1 = arr1.some( isEvenNumber );
let value2 = arr2.some( isEvenNumber );
console.log( value1 );
console.log( value2 );