1.
(1) Assigning values to new array members using an index value that exceeds the "array length-1"
(2) The length of the force setting array is less than the current length, causing the array to be truncated.
2.
Basic operations for Arrays
(1) Find: IndexOf (from left to right), lastIndexOf (right to Zocha)
directly queries the index of the target array.
Eg:
destination array. indexOf (the element to find)
destination array. lastIndexOf (the element to find)
You can also define where to start the lookup.
eg:
destination array. indexOf (the element to find, the starting position of the lookup)
target array. lastIndexOf (the element to find, The starting position of the lookup)
(2) new element: Push (add one or more at the end), Unshift (add one or more in the header)
The push and Unshift methods return the array length after adding the element
eg:
Array. Push (element 1, Element 2,...); An
array. unshift (element 1, Element 2,...);
(3) to delete the elements of the array: Pop (delete the last element), shift (the first element of the array is deleted, the remaining element index value is automatically minus 1)
Pop and shift return the deleted element
EG:
array. Pop ();
Array. Shift ();
(4) Splice: You can insert or delete elements in an array flexibly.
(5) Slice: Gets the partial element in the array.
Note: The difference between splice and slice.
(6) Concat: Combining multiple elements or arrays into a new array
Note: The difference between concat and push.
3.
Deep copy and shallow copy of the array (note when the array elements are complex type data.) )
4.
Sort: Reverse,sort,sorton.
5.
Manipulate the values for each element: Foreach,every,filter,maparsefloat,some.
"Flash ActionScript 3 Palace Road", chapter 12, array