JavaScript Array : Object
Creates an empty Array (length = 0). Can also be constructed as [].
Example:
RunResults:
Instance Methods
Returns a new Array composed of the items of this followed by item0, item1, .... To concat with another Array, you can use Function.call to pass the second Array's items to concat.
Example:
RunResults:
Returns true if callback returns true for every item in this. Otherwise returns false. The Array passed to callback is the this of the call to every.
Example:
RunResults:
Returns a new Array containing only the items in this that callback returned true for. The Array passed to callback is the this of the call to filter.
Example:
RunResults:
Calls callback for each item in this. The Array passed to callback is the this of the call to forEach.
Example:
RunResults:
Returns the first location of item in this starting the search from startingIndex. If startingIndex is negative, this.length is added to it before starting the search. Returns -1 if item is not found.
Example:
RunResults:
Returns a String created by joining the toString() of each item of this separated by separator.
Example:
RunResults:
Returns the location of item in this starting the search from startingIndex by searching backwards through the array. If startingIndex is not specified, the search starts from the end of the array. If startingIndex is negative, this.length is added to it before starting the search. Returns -1 if item is not found.
Example:
RunResults:
Returns a new Array with where each item is the result of calling callback on each item in this. The Array passed to callback is the this of the call to map.
Example:
RunResults:
Removes the last item from this and returns the removed item. Returns undefined if this is empty. Use with push to treat an Array as a stack.
Example:
RunResults:
Appends the specified items to the end of this and returns the new value of this.length. Use with pop to treat an Array as a stack.
Example:
RunResults:
Calls callback for each item in this and passes the return value of callback as the previous parameter to the next callback invocation. Returns the result from the last call to callback. If initialValue is not specified, callback will first be called on this[1] with previous set to this[0]. The Array passed to callback is the this of the call to reduce.
Example:
RunResults:
Calls callback for each item in this in reverse order and passes the return value of callback as the previous parameter to the next callback invocation. Returns the result from the last call to callback. If initialValue is not specified, callback will first be called on this[this.length - 2] with previous set to this[this.length - 1]. The Array passed to callback is the this of the call to reduceRight.
Example:
RunResults:
Removes the first item of this and shifts the remaining items down by 1. Returns the removed item.
Example:
RunResults:
Returns a new Array which is composed of the items this[start], this[start + 1], ..., this[end - 1]. Note that item[end] is not included. If start or end is negative, the value is added to this.length before performing the slice. If end is not specified, this.length is used.
Example:
RunResults:
Returns true if callback returns true for at least one item in this. Otherwise returns false. The Array passed to callback is the this of the call to some.
Example:
RunResults:
Sort the items of this using comparisonFunction to determine the sort order and returns this. The Number returned by comparisonFunction should be 0 if x and y are equal, negative if x is less than y, or positive if x is greater than y. If comparisonFunction is not specified, the toString() of the items will be sorted in alphanumeric order.
Example:
RunResults:
Removes count items from this starting at index start. If the optional items are specified, they are inserted into this at start. Returns a new Array containing the removed items.