array
Methods on every array.
Functions
| append | array.append(value, ...): any | Adds one or more values to the end of the array. |
| apply | array.apply(callback: function): any | Replaces every element with the result of callback on it. |
| clear | clear(): any | Removes every element from the array. |
| clone | clone(): any | Makes a shallow copy of the array. |
| constructor | constructor(size: number, [default_value], ...): any | Creates an array of size elements, each set to default_value. |
| contains | array.contains(value): any | Reports whether any element equals value. |
| each | array.each(callback: function): any | Calls callback once per element, in order. |
| extend | array.extend(other: array, ...): any | Appends every element of other to this array. |
| filter | array.filter(callback: function): any | Collects the elements for which callback returns a true value. |
| findindex | pure array.findindex(callback: function): any | Finds the index of the first element for which callback returns a true value. |
| findvalue | pure array.findvalue(predicate: function, [default_value], ...): any | Finds the first element for which predicate returns a true value. |
| hasindex | pure array.hasindex(index: number): any | Reports whether index is a valid element index. |
| hasvalue | pure array.hasvalue(value): any | Reports whether any element equals value. |
| indexof | pure array.indexof(value): any | Finds the index of the first element that equals value. |
| insert | array.insert(index: number, value): any | Inserts value before the element currently at index, shifting the rest up by one. |
| is_frozen | is_frozen(): any | Reports whether this array reference is frozen. |
| len | pure array.len(): any | Returns the number of elements in the array. |
| map | array.map(callback: function): any | Builds a new array from the results of callback on each element. |
| pop | array.pop(): any | Removes and returns the last element. |
| reduce | array.reduce(callback: function, [initial], ...): any | Folds the array down to one value by repeatedly combining an accumulator with each element. |
| remove | array.remove(index: number): any | Removes the element at index, shifting the rest down by one. |
| replace | array.replace(other: array): any | Deprecated alias of replace_with. |
| replace_with | array.replace_with(other: array): any | Overwrites this array's elements with other's. |
| resize | array.resize(size: number, ...): any | Grows or shrinks the array to size elements. |
| reverse | array.reverse(): any | Reverses the array in place. |
| slice | array.slice([start: number, end: number], ...): any | Copies the elements from start up to, but not including, end. |
| sort | array.sort([comparator: function], ...): any | Sorts the array in place. |
| swap | array.swap(index1: number, index2: number): any | Swaps the elements at index1 and index2. |
| top | array.top(): any | Returns the last element without removing it. |
| tostring | tostring(): any | Returns the default text representation of this array. |
| totable | pure array.totable(): any | Builds a table from the array's elements. |
| weakref | weakref(): any | Returns a weak reference to this array. |