Editor Arrow Download Open
<html> <head> <title>JavaScript Array sort() function</title> </head> <body> <script type="text/javascript"> function Sort_Number(x, y) { return x - y; } var num = ["12", "20", "58", "8", "45", "90"]; document.write("Sorting Numbers: " + num.sort(Sort_Number)); </script> </body> </html>
  Preview Arrow