1. Create an Array object
Syntax for creating an array object
var array name = new Array ();
After the array is defined. You need to add elements to the array. Formats such as the following
Array name [< subscript >]= value;
2. Array Object Properties
The array object provides only 4 properties
Index: The character matches the position of the string, or the return-1 is not found
Input: Specifies the original string that matches the normal table expression
Length: Returns the size of the array, that is, how many elements are in the array, which makes it easy to traverse the log group
Prototype: Adds a newly defined property or method to the array object, and then an instance of the object can invoke the property or method
3. Array Object method
Concat (): For object link Reference, copy its value for character or string
Join (): All elements separated by the specified delimiter
Pop (): Removes the last element from the array and returns the element, assuming the array is empty. Then return to underfined
Push (): Appends new elements in the order in which they appear
Shift (): Removes the first element in the array and returns it
Unshift (): Inserts these elements at the beginning of an array so that they are sorted by their order in the tables
Reverse (): Rearrange the elements of the array in the direction opposite to the original
Sort (): Returns the sorted array object, with default elements sorted in ascending order of ASCII characters
Splice (): Changes the array by removing the specified number of elements starting at the start position and inserting a new element. The return value is a new array object that consists of the elements that are removed
Tolocalstring (): Returns a value in the form of a string value. This value is appropriate for the locale of the current environment
ToString (): Returns the string representing the object
ValueOf (): Returns the original value of the specified object
The array object in JavaScript