Name |
Description |
Array. Add function |
Add an elementArrayThe end of the object. Array. Add (array, item ); |
Array. addrange Function |
Copy all elements of the specified arrayArrayThe end of the object. Array. addrange (array, items ); VaR A = ['A', 'B', 'C', 'D']; VaR B = ['F', 'G', 'H']; Array. addrange (A, B ); |
Array. Clear Function |
SlaveArrayRemoves all elements from an object. Array. Clear (array ); |
Array. Clone Function |
CreateArrayA superficial copy of an object. VaR clonevar = array. Clone (array ); |
Array. Contains Function |
Determine whether an element is inArrayObject, return bool type. VaR itemexists = array. Contains (array, item ); |
Array. dequeue Function |
SlaveArrayRemoves the first element from the object. VaR firstelement = array. dequeue (array ); |
Array. enqueue Function |
Add an elementArrayThe end of the object. Array. enqueue (array, item ); |
Array. foreach Function |
PairArrayEach element of the object performs the specified operation. Array. foreach (array, method, context ); VaR A = ['A', 'B', 'C', 'D']; A [5] = 'E '; VaR result = ''; Function appendtostring (element, index, array ){ // "This" is the context parameter, I. e. '| '. Result + = element + This + index + ','; } Array. foreach (A, appendtostring, '| '); // View the results: A | 0, B | 1, C | 2, d | 3, E | 5, Alert (result ); |
Array. indexof Function |
SearchArrayThe specified element of the object and the index of the element is returned. VaR indexvar = array. indexof (array, item, start ); |
Array. Insert Function |
InArrayInsert a value at a specified position in the object. Array. insert (array, index, item ); |
Array. parse function |
Create from string representationArrayObject. VaR A = array. parse (value ); The parse function fills the current array by splitting the string in the value. The format of the string in value must be "['item1', 'item2', 'item3']", and must contain quotation marks. |
Array. Remove Function |
RemoveArrayThe first match of an element in the object. VaR isremoved = array. Remove (array, item ); Return bool type, whether it has been removed. |
Array. removeat Function |
RemoveArrayThe element at the specified position in the object. Array. removeat (array, index ); |