Methods
get()
Returns a specific element.
It is recommended to check that you are going to specify a valid index number
before calling this method.
Returns:
The specified element.
getLast()
Returns the last element.
It is recommended to check that this array is not empty before calling this method.
Returns:
The last element.
loop(callback)
Executes a provided function once for each array element.
Parameters:
Name | Type | Description |
---|---|---|
callback |
loopArrayCallBack
|
loopBackwards(callback)
Executes a provided function once for each array element in descending order.
Parameters:
Name | Type | Description |
---|---|---|
callback |
loopArrayCallBack
|
nestedLoopJoin(otherArray, callback)
Joins two arrays and executes a provided function once for each joined pair.
Parameters:
Name | Type | Description |
---|---|---|
otherArray |
LoopableArray
|
|
callback |
elementPairCallback
|
pop()
Removes and returns the last element.
It is recommended to check that this array is not empty before calling this method.
Returns:
The last element.
push(element)
Adds one element to the end of the array and returns the new length of the array.
Parameters:
Name | Type | Description |
---|---|---|
element |
The element to add to the end of the array. |
pushAll(otherLoopableArray)
Adds all elements from another LoopableArray and returns the new length of the array.
Parameters:
Name | Type | Description |
---|---|---|
otherLoopableArray |
LoopableArray
|
pushRawArray(array)
Adds elements to the end of the array and returns the new length of the array.
Parameters:
Name | Type | Description |
---|---|---|
array |
Array
|
The elements to add to the end of the array. |