Creating an Array: Difference between revisions

m (Remove this deprecated task from library's categories.)
(→‎ActionScript: Delete.)
Line 6:
In this task, the goal is to create an [[array]]. Mention if the [[array base]] begins at a number other than zero.
In addition, demonstrate how to initialize an array variable with data.
 
==[[ActionScript]]==
<lang actionscript>
// ActionScript arrays are zero-based
//
// creates an empty array
var arr1:Array = new Array();
// creates an array with 3 numerical values
var arr2:Array = new Array(1,2,3);
//
// or just use the shorthand
var u:Array = [];
var v:Array = [1,2,3];
</lang>
 
==[[Ada]]==
Anonymous user