# array
The Concept of # # # array
* Array is an ordered set of values
* Each value in the array is called an element
* Each element can be a value of any data type
* Each element has an index (subscript)
* The index of the element starts at 0 and increments in order. The element's largest index 2^32-2
# # # Create an array
* Direct Volume ' [] '
* Constructor Method ' new Array () '
# # # Read and write elements in an array
* array name [index]
# # # Sparse Array
* The index of the JS array is continuous
* There is no continuous assignment to the element, and the element with no assignment is automatically assigned to the value undefined
< Span style= "COLOR: #008000" >
# # # Add and remove elements of an array
* add an array element
* Specify an index to add an element
* The array length as the index of the new element "Arr[arr.length ] = value '
* at the end of the array add element push () " Arr.push () '
* add element before array unshift () ' Arr.unshift () '
* add elements anywhere in a number array Splice (index, 0, value)
< Span style= "COLOR: #008000" > < Span style= "COLOR: #808080" >
* delete elements of an array
* change the Length property of the array ' arr.length-= 1; arr.length-= 2 '
* Delete The most subsequent element pop ()
* Deletes the first element of an array shift ()
* deletes the specified number of elements at the specified position splice ( index, length)
# # # Array traversal
* For Loop
* For in
Span style= "COLOR: #b22222" >### multidimensional array
### Array method
* join ([spacer symbol]) stitch Each element of an array into a string return string
Span style= "COLOR: #808080" >* slice (start, end) intercept part of the array, returning a new array
* concat (arr, arr ....) merging arrays. Returns a new array
* tostring () converts an array to a string
* reverse () flip array side effects
* sort () sort Side effects
* push () Pop () side effects
* shift () unshift () side effects
< Span style= "COLOR: #808080" > < Span style= "COLOR: #808080" >
### class Array Object
* arguments
* elementcollection elements
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
document.getElementsByTagName ()
element.getelementsbytagname ()
< Span style= "COLOR: #b22222" > < Span style= "COLOR: #808080" > < Span style= "COLOR: #008000" >
### the string as an array
Span style= "COLOR: #808080" The >* string has a partial array attribute
* string also has the length property to get the lengths of the string
. Span style= "COLOR: #808080" >* can also remove a character from a string by [index value]
08.18 JavaScript 06 array array concept create array read elements in array sparse array add and delete array of elements array traversal method class array array object as array string