First, the common operation
ToString (): Converts an array to a string
toLocaleString (): Converts an array to a string
Join (): Converts an array to a symbolic concatenated string
Shift (): Moves an element of the array head out
Unshift (): Inserts an element in the head of an array
Pop (): Deletes an element from the tail of the array
Push (): Adds an element to the tail of the array
Concat (): Adding elements to an array
Slice (): Returns the part of an array
Reverse (): Sort the array backwards
Sort (): Sort operations on an array
Splice (): Inserting, deleting, or replacing an array element
Second, delete the array to specify the subscript element code
<script>var arr = [' A ', ' B ', ' C ', ' d ', ' e ']; function Arr_del (d) { return arr.slice (0,d-1). Concat (Arr.slice (d));} Alert (Arr_del (// a,b,d,e</script>
Slice method Summary: Join Arrayobj=[george,john,thomas,james,adrew,martin]
1) arrayobject.slice (start,end) Gets the [start, end] element, containing start without the End,arrayobj.slice (2,4) result as Thomas,james
2) Arrayobject.slice (d) Gets the [D,end] element, starting from D until the end, Arrayobj.slice (4) results are Adrew,martin
Iii. Methods of Concat
You can concatenate two or more arrays without changing the existing array, returning only the copy of the connected array!
Array1 = [+]; array2=[3,4]; array=[5,6]
1) Connection value
Array1.concat (4,5) array1 unchanged, but the returned array is [1,2,4,5]
2) Connect two or more arrays
Array1.concat (array2) returns an array of [1,2,3,4]
Array1.concat (ARRAY2,ARRAY3) returns an array of [1,2,3,4,5,6]
Operation of the "JavaScript" string