/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var a:Array = [1, 2, 3, 4, 5]; var b:Array; //clone a: b = a.map(function(e:*, ...r):*{ return e }); /* "...r" is a "rest" and stands for the two more arguments, the function in map(f:Function, target:Object = null) needs. Full function would be: function (element:*, index:int, array:Array):*{return e}; */