ArrayEvery

This function calls a given closure/function with every element in a given array and returns true, if all of the closure calls returns true.

Returns: boolean

Usage

ArrayEvery( array, closure [, parallel [, maxThreads ] ] )

Arguments

Argument Description Default
array
(array, required)

array to iterate

closure
(function, required)

function/closure that implements the following constructor [function(any value[, numeric index,array array]):boolean].

parallel
(boolean, optional)

execute closures parallel

maxThreads
(number, optional)

maximum number of threads executed, ignored when argument "parallel" is set to false

20

Examples

Loops over every element in the array

arr1 = [12,0,1,2,3,4,5,6];
arr1.every(function(item,index,arr){
    dump(item & ', ' & item + 5);
    return true;
},true,4);

See also