Java Reference
In-Depth Information
Method
Introduced
Description
join([separator])
JavaScript 1.1
Joins all the elements of an array into a
single string delimited by separator if
specifi ed.
lastIndexOf(element
[, startIndex])
JavaScript 1.6
Searches an array starting at last ele-
ment and moves backwards. Returns
an index of the specifi ed element if
found, or -1 if not found. Starts at
startIndex if specifi ed.
map(fn(element, index,
array))
JavaScript 1.6
Iterates over the array, executing fn()
on every element. Returns a new array
based on the outcome of fn() .
pop()
JavaScript 1.2
Pops the last element from the end of
the array and returns that element.
push(value1 [, value2, …])
JavaScript 1.2
Pushes one or more elements onto the
end of the array and returns the new
length of the array. The array's new
length is returned.
reverse()
JavaScript 1.1
Reverses the order of the elements in
the array, so the fi rst element becomes
the last and the last becomes the fi rst.
shift()
JavaScript 1.2
Removes the fi rst element from the
beginning of the array and returns
that element.
slice(startIndex [, endIndex])
JavaScript 1.2
Returns a slice of the array starting at
the start index and ending at the ele-
ment before the end index.
some(testFn(element, index,
array))
JavaScript 1.6
Iterates over the array, executing
testFn() on every element. Returns
true if at least one result of testFn()
is true .
sort([sortFn(a,b)])
JavaScript 1.1
Sorts the elements of the array.
Executes sortFn() for sorting if it is
provided.
splice(startIndex [, length,
value1, …)
JavaScript 1.2
Removes the amount of elements
denoted by length starting at
startIndex . Provided values replace
the deleted elements. Returns the
deleted elements.
toString()
JavaScript 1.1
Converts the Array object into a string.
Continued
Search WWH ::




Custom Search