Navigation Home / Tags / json

ranking Sort Sort   |   date Sort Sort   |   member Sort Sort

Date Submitted Sun. Jan. 28th, 2007 1:18 PM
Revision 1
Scripter Fordiman
Tags JavaScript | json | sort
Comments 0 comments
Flexible sorting algorithm based on Quicksort with extra functionality, such as:
- Direction (ie: ascending or descending)
- Sort-by-path (eg:, or item[5])
- Sorting function (returns true if two items are already sorted)
- Type checking
- All constants and support functions are members of the Sort() function
- Testsuite with hooks for cscript and in-browser javascript, so you can tweak and optimize, and make sure it still works
- Environment agnostic (can use with, say, SpiderMonkey or .Net's jsc)