15 lines
276 B
JavaScript
15 lines
276 B
JavaScript
|
|
|
|
var arraySome = function( array, callback ) {
|
|
var i, length;
|
|
if ( array.some ) {
|
|
return array.some( callback );
|
|
}
|
|
for ( i = 0, length = array.length; i < length; i++ ) {
|
|
if ( callback( array[ i ], i, array ) ) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
|