Javascript Sorting an Array.

The array object provides a sort method that does just this: It returns a comma-separated list of the elements in sorted order. Sorting is performed in ascending
order alphabetically or numerically as appropriate.
To use the method, simply call it:

Syntax:

arrayName.sort();

Example:

<script language="JavaScript">

var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(fruits.sort());

</script>

Output:

Apple, Banana, Mango, Orange

DOWNLOAD SOLUTION HERE