Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Arrays/ActionScript/arrays.as
Normal file
16
Task/Arrays/ActionScript/arrays.as
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
//creates an array of length 10
|
||||
var array1:Array = new Array(10);
|
||||
//creates an array with the values 1, 2
|
||||
var array2:Array = new Array(1,2);
|
||||
//arrays can also be set using array literals
|
||||
var array3:Array = ["foo", "bar"];
|
||||
//to resize an array, modify the length property
|
||||
array2.length = 3;
|
||||
//arrays can contain objects of multiple types.
|
||||
array2[2] = "Hello";
|
||||
//get a value from an array
|
||||
trace(array2[2]);
|
||||
//append a value to an array
|
||||
array2.push(4);
|
||||
//get and remove the last element of an array
|
||||
trace(array2.pop());
|
||||
Loading…
Add table
Add a link
Reference in a new issue