forEach on arrays

forEach is a nice wee function to speed some bizzo up on particular arrays.

myArray.forEach(myFunction); // for each item in this array, runs myFunction function.
}

public function myFunction(element:*, index:int, arr:Array):void
{
// element returns the current item (ie. myArray[0] etc. and the rest is clear)
}
Tech Reference:

Leave a Reply

Your email address will not be published. Required fields are marked *

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑