new tasks
This commit is contained in:
parent
2a4d27cea0
commit
80737d5a6a
1194 changed files with 15353 additions and 1 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