Array Methods

Domain Hosting image
Web Hosting
Dedicated server
ssl certificate
Web Design image
Email
toString() This method returns a string of the array elements. The array elements in the string are seperated by commas.

join()

Join method is similar to the toString method except that a separator string can be given . If no separator is mentioned, commas separate the array elements. The syntax for join method is:

join(separator)

reverse()

As the name indicates the reverse method is used to reverse the elements in an array.

sort()

The sort function sorts the elements of an array in the dictionary order. An optional comparison function can be given based upon which the sorting is done. In case the comparison function is given it should take in two parameters. The function should return a negative number if the first parameter is less than the second, zero if both parameters are equal and a positive number if the first parameter is greater than the second.



Domain Name Search

www.


Copyright (C) 2007. Web Domain design hosting. All rights reserved.