Common JavaScript Manual/Data types - Arrays

Making Array
For making array it's better to use list literal because it's most popular and simple syntaxis

Work with elements
And so, we have an array 'b' with five numbers and the empty array 'a'.


 * 1) From array b - [1,2,3,4,5] get element with index 2 (Numeration in arrays starts from 0).  Now array a = [2]
 * 2) We delete element with index 2 from array b. Now array b = [0,1,undefined,3,4].
 * 3) We change value of element with index 3 from array b. Now array b = [0,1,undefined,6,4].

Work with slices
Array.slice(start,end) - returns array with elements of Array from start index to end index without element with index end. If start or end is negative number then index of start or end equal (length of array + start or end). Array.splice(start,number,elem...) - return slice with number of elements from Array from start and it deletes this elements from Array, and it replaces it's by elem

Stack and row
You can use any Array as stack or row for it there are 4 function. For example:

Sorting and reverse
Also Array.sort([predicate]) - If predicate not defined then sort elements in Array in lexicographical order else sort element in Array by results of function predicate that gets two arguements and returns -1 if first argument less then second or 1 if second argument less then first or 0 if arguments equal.

Array.reverse - reverse elements in Array

Concatenate and joining
Array.concat(elem1...) - returns array that containg elements from Array and elem if elem[n] is array then to the array that returns are added all elements from elem[n].

Array.join([separator]) - returns string with all elements and separator before every, if separator not defined then separator = ","

Length of Array
Array.length - number of elements in Array