How to create an array:
1)
<script type= ' text/javascript ' > varnew Array (1,2,3,4, ' abc ', 3)</script >
2) (this is actually used in many, high efficiency)
<scripts type= ' text/javascript ' > var aRr02 = [All-in-all, ' SD ']; </script>
Operation:
1) Gets the number of members of the array:
Aleart (Arr02.length)
2) Popup array contents (PIN starting from 0)
Aleart (Arr02[3])
3) Connection string: Join ()
var str1 = Arr02.join ("-")var str2 = Arr03.join ("")
4) Add Delete member from the back of the array: Push (), pop ()
Arr02.push ("a")
Arr02.pop ();
5) Add Delete member from front of array: Unshift (), Shift ()
Arr02.unshift (' a '); Arr02.shift ();
6) Invert the array: reverse ()
Arr.reverse ();
7) Returns the index value of the first occurrence in the array element: IndexOf ()
var aRr2 = [' A ', ' B ', ' C ', ' d ', ' A ', ' B ', ' C ', ' d ' ]; var num = arr2.indexof (' B '); alert (num); // pop up 1
8) Add or remove elements from the array: Splice ()
Arr2.splice (2,1); alert (ARR2)// start deleting 1 elements from the subscript 2 element
Arr2.splice (2,1, ' e '); alert (ARR2)//start by deleting 1 elements from subscript 2 and inserting e into the element labeled 2 here
Two-dimensional arrays:
var aRr03 =[[1,2,3],[' A ', ' a ', ' d '],[true]]
The difference between = = and = = =:
= = Two data to be compared before being judged equal to the same data type
= = = Does not convert the data type, directly compared, if the data type is different, then this judgment must be unequal.
js--the difference between arrays, = =, and = =