Javascript Array - list of methods


We have already seen some of the methods the array provides - length, pop, shift, unshift and push. Here are some more methods that javascript provides.

concat() -	Joins two (or more ) arrays, and returns the joined arrays
indexOf() -	Search the array for an element and returns it's position
join() 	- Joins all elements of an array into a string
lastIndexOf() -	Search the array for an element, starting at the end, and returns it's position
reverse() 	Reverses the order of the elements in an array
slice() 	Selects a part of an array, and returns the new array
sort() 	Sorts the elements of an array
splice() 	Adds/Removes elements from an array
toString() 	Converts an array to a string, and returns the result
valueOf() 	Returns the primitive value of an array

We will take a look at these in next pages.