slice(-4,-2);
Copy()
The copy method is applied to the entire Array, creating an exact duplicate, and takes no parameters:
var arrayCpy : Array < Int > = myArray.copy();
Be warned that the copy and slice methods do not create duplicates of the contained data. Therefore,
if your original Array contains objects, the data of the copied Array will contain references to those
objects, not duplicates.
Now that you can copy Arrays, what about copying one Array to the end of another? This is known as
concatenation, and can be applied to Arrays using the concat method.
Concat()
The concat method copies the structure of the given Array to the Array that calls the method. The items
in the concatenated Array are not duplicated, but passed by reference, though this is not an issue if the
values are of a base type such as an Int or String :
myArray.concat(newArray);
Multidimensional Arrays
Multidimensional Arrays, while sounding like something out of Star Trek, provide a very useful feature
in haXe. Otherwise know as a matrix (matrices in plural), multidimensional Arrays can help deal with
groups of groups, or groups of groups of groups .
Pages:
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126