The 4-dimensional orbit of the Earth around the Sun is a helix with pitch 63,000 times bigger than the radius.
justfigures

a resource for web developers...

       

Search Amazon

JavaScript: Array object reference


Lists the Array object methods and properties.


Back to JavaScript: Arrays


Array object methods:


concat(array1,...)

Joins two or more arrays and returns the result. Requires at least one array as an argument.

join('delimiter')

Puts all the elements of an array into a string. The elements are separated by a specified delimiter. If no delimiter is specified a comma is used.

pop()

Removes and returns the last element of an array.

State change.

push(element,...)

Adds one or more elements to the end of an array and returns the new length.

State change.

reverse()

Reverses the order of the elements in an array.

State change.

shift()

Removes and returns the first element of an array.

State change.

slice(index,index)

Returns selected elements from an existing array specified by the index positions. Only the first argument is required.

sort(function)

If a function is not specified then sorts the elements of an array into dictionary order, for example if numbers then 1,10,2,3....

State change.

splice(index,length,element,...)

Removes and/or adds new elements to an array. The second argument is the number of elements to be removed and can be 0. The element arguments are not required but are the elements to be added. Note that the splice method returns the elements it has removed from the array. Extremely useful and flexible method.

State change.



Array object properties:


length

Returns the number of elements in an array .


Rate this page:








Back to top.

 

Bookmark and Share

 

Copyright © 2006-2010 justfigures.co.uk