An array is an object in javascript. It has useful method to play with
Is the explode php equivalent. turns an string into a array using a separtor
(123456789).toString(10).split("")
["1", "2", "3", "4", "5", "6", "7", "8", "9"]
Is the implode php equivalent. It turn an array into an String
[8, 3, 2, 9, 8, 3, 2].join("-")
"8-3-2-9-8-3-2"
Method creates a new array with the results of calling a provided function on every element in this array.
he push() method adds a new element to an array (at the end). It returns the new array length.
The pop() method removes the last element from an array. Returns the value that was poped out.
Shifting is equivalent to popping, working on the first element instead of the last.
The unshift() method adds a new element to an array (at the beginning).
(123456789).toString(10).split("").map(function(t){return parseInt(t)})
[1, 2, 3, 4, 5, 6, 7, 8, 9]
Or
(123456789).toString(10).split("").map(function(t){return Number(t)})
[1, 2, 3, 4, 5, 6, 7, 8, 9]