On Fri, Jul 3, 2009 at 10:12 AM, Ian Horst <[email protected]> wrote:
> I wonder why there are 2 sort methods, one for ascending, second for > descending. > > It's enough to define ascending sort method. Descending is just > reverse of ascending sort method. > > ascending: > ascSortMethod(); > > descending: > - ascSortMethod(); > Hi Ian, The sort method is passed to Array.sort(). According to my O'Reilly book, there's no mechanism for specifying that the sort order should be reversed. One could use the Ascending sort function to sort the array followed by a call to Array.reverse if a descending sort was requested, but that sounds mighty inefficient. Maybe there's a feature of a later version of Javascript (my book is old; it covers up through 1.5) that allows sorting in reverse, but I think we'd still need both sort functions anyway to support older browsers. Derrell
------------------------------------------------------------------------------
_______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
