Applies the function to each of the elements in the array


BOOLEAN = ArrayEach( array, function )
Argument Summary
array Array Object
function function to loop over the data, passing in the element as the parameter to each. function(el){}


Supports named-parameter calling allowing you to use the function like:


Supports passing parameters as a structure using ArgumentCollection:

ArrayEach( ArgumentCollection={
   array : ?, 
   function : ?
} );


You can easily iterate over the elements of an array by using the ArrayEach() function or the .each() feature.

// Create a sample array
arr = ["alan", "ceri", "andy", "jamie" ];

// Callback function declared that accepts the element
function arrayLoop(el){
  WriteDump( el );

// Loop around each element
ArrayEach( arr, arrayLoop );

// Alternatively you can loop using the .each()
arr.each( arrayLoop );

For each element in the array, the function 'arrayLoop' is called, passing in the current element. The callback function sits within the variable scope of the calling function, so it can interact with variables outside of itself.