Used to loop over the array to create a new array based on the inner function applied to each element that will return true/false if it is to be included


ARRAY = ArrayFilter( array, function )
Argument Summary
array Array Object
function function to loop over the data, passing in the element as the parameter to each. each function call should return true or false; function(element){}


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


Supports passing parameters as a structure using ArgumentCollection:

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


Creates a brand new array using the elements from the previous one, by using a callback function to determine whether or not the element should be included. The callback function must return either true/false.

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

// Callback function declared that accepts the element
function arrayLoopCallback(el){
  if ( el.startsWith("a") )
    return true;
    return false;

// Create a new array from the old one
newArr = ArrayFilter( arr, arrayLoopCallback );