CS4 array map with action script
This code show how to use map with Array.
var originalArray:Array = new Array(1,2,3,4,5);
function getDouble(elem:*, i:int, a:Array):Number {
return elem * 2;
}
var multipliedArray:Array = originalArray.map(getDouble);
trace('output: ', originalArray);
// output: 1,2,3,4,5
trace('output: ', multipliedArray);
// output: 1,4,6,8,10