1.Create an Array.
1 | /** Create an array **/ |
2.Access values
1 | var arrValue = arrayObj[1]; // get the value |
3.Add items to an Array
1 | //Add one or more items to the end of the array, return the array length |
4.Delete items from an Array
1 | //remove the last item of an array and return this item |
5.Select items from an array or join two or more arrays
1 | //select items from position start to end as a new array and return it. |
6.Copy an array
1 | arrayObj.slice(0); //return a new copy of the array |
7.Sort an array
1 | arrayObj.reverse(); //return the reverse of an array |
8.Array to string
1 | arrayObj.join(separator); //joint the items of an array with separator |