Rest args
From JASPA
Contents |
Introduction
The AS3-style "rest" symbol is a triple dot sequence: ..., but is a single token as far as the syntax is concerned. It is fully supported by JASPA and is inherent in the syntax of the JAS language. At runtime this is handled transparently by the native JavaScript that the JASPA compiler generates.
Example
The symbol may precede the final argument in a function declaration as follows:
function doSomething( required:String, ...more:Array ):void { print( more.length ); } doSomething('a','b','c'); // outputs "2"
See Also
- The JAS language
- Similarity of JAS to ActionScript & AS3

