I have a dynamic array created like this:
window.IDarray = [];
And I have a dictionary created like this:
window.itemdictionary = {};
The length of window.IDarray is the same as window.itemdictionary.
And the values of window.IDarray are unique. Also the values of window.IDarray are the keys to the window.itemdictionary.
The datatype of the "value" of any key in window.itemdictionary is also a dictionary that contains a key called "modified" and the value is a string date of the format example "Mon May 28 11:20:46 EDT 2012".
What is the best way to sort the values of window.IDarray, so that going from index 0 to the end of window.IDarray, its corresponding dates in window.itemdictionary are getting farther from the current date? (i.e. index 0 will give closest date to the current date, and index n will give the date farthest away).
new Date()anddate_aanddate_band then compare the differences for the result of your comparator function.