JavaScript Reference/Javascript Methods/sort
"sort()" Example
<html>
<body>
<button onclick="var myA = new Array(0,5,3,1,2,4,6);
myA.sort();
alert(myA);">sort array</button>
</body>
</html>
"sort()" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |Array |
+----------------+--------------------------------------------------------------+
"sort()" Syntax, Parameters and Note
Note:
Sorts the elements in the array alphabetically.
Syntax:
arrayName.sort()