Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

some

The some() method of the Array object is used to see if at least one element in an array passes the evaluation provided in the callback function. A boolean value is returned. It will stop evaluating elements at the first occurrence of a 'true' return value from the callback function.

Syntaxarray.some( callback )

Parameters

callback Reference a callback function that will evaluate each element in the array. element - represents each element of the array individually as they pass through the callback. index - indicates the index number of the element passing through the callback. array - a reference to the array object calling the every() method.

Examples

Check to see if at least one element in the array is greater than 10. function checkData( element, index, array ) { return element > 10; } var data = [5,8,12,7]; alert( data.some( checkData ) ); /* true */

JavaScript

Methods

addEventListeneralertaveragebackblurconcatcreatedecodeURIdecodeURIComponentencodeURIencodeURIComponentevaleveryfilterforwardgoisArrayisFiniteisNaNjoinparseFloatparseIntpoppushpushStatereducereplaceStatereverseshiftshuffleslicesomesortspliceunshiftwrite