When defining arrays in ActionScript 3 using the shorthand array access operator (brackets), you can now have a trailing comma following the last element without causing an error (like in PHP). This makes working with multi-line array definitions a little less error-prone when rearranging elements. Ex:
ActionScript Code:
var myList:Array = [
"The",
"quick",
"brown",
"fox",
];
In ActionScript 1 and 2, the comma after "fox" would create an error. This is not the case in ActionScript 3.
Note: this does not work with Array() or new Array(), only [].

0 评论:
发表评论