JavascriptArray Object Array Object
The Array object is used to store multiple values in a variable:
var cars = ["Saab", "Volvo", "BMW"];
The first array element has an index value of 0, a second index value of 1, and so on.
For more information about the JavaScript array reference manual, refer to the JavaScript array object manual.
Array Object Properties
Method |
Description |
Concat () |
Joins two or more arrays and returns the result. |
Every () |
Detects whether each element of a numeric element meets the criteria. |
Filter () |
Detects a numeric element and returns an array of all elements that match the condition. |
IndexOf () |
Searches for an element in an array and returns where it is located. |
Join () |
Put all the elements of the array into a string. |
LastIndexOf () |
Returns the location of the last occurrence of a specified string value, followed by a search in a string at the specified position. |
Map () |
Processes each element of an array by specifying a function and returns the processed array. |
Pop () |
Deletes the last element of the array and returns the deleted element. |
Push () |
Adds one or more elements to the end of the array and returns the new length. |
Reverse () |
Reverses the element order of the array. |
Shift () |
Deletes and returns the first element of the array. |
Slice () |
Selects a portion of the array and returns a new array. |
Some () |
Detects if there are elements in an array element that meet the specified criteria. |
Sort () |
Sorts the elements of an array. |
Splice () |
Adds or removes an element from an array. |
ToString () |
Converts the array to a string and returns the result. |
Unshift () |
Adds one or more elements to the beginning of the array and returns the new length. |
ValueOf () |
Returns the original value of the array object. |
JavaScript Array Object Reference Manual