Numeric Array Sort
General
JavaScript's Array object only sorts alphabetically. That means if you pass it an array of numbers it will sort the array alphabetically (1,15,100,2,25,200) instead of numerically (1,2,15,25,100,200). This is easily fixed by adding a new method which will sort a numerical array very nicely.
Current Array: 5,9,12,18,56,1,10,42,30,7,97,53,33,35,27
Notes
- Created by: Patrick Hunlock
- Web Site: http://www.hunlock.com
- Posted: March 21, 2007
Source Code
Paste this source code into the designated areas.
Head
Paste this code into the HEAD section of your HTML document.
Body
Paste this code into the BODY section of your HTML document


Leave a Response
(1 comment)This Numeric Array Sort is very clever. An alternate approach which is very simple. One of the most usable scripts submitted for a long time.