Javascript Array Sort

One of the most useful array methods is sort().  It will sort your content. The sort() works  much like the qsort() functions in the standard library. This method sort the array element in  place according to lexicographic order. First it convert the array elements to a string and then sorting them lexicographically. This can cause an unexpected result in some cases.

Example of Javascript Array Sort :- 



<title> I am working on javascript</title>


var myarray=[34,45,56,13,90];





<p>  Array is sort in javascript</p>



Result of Javascript Array Sort 

13 , 34 , 45 , 56 , 90

Follow Us

Contact Us

Back to Top