returns !b,223,23,45,664,672,@b,mansion while it is supposed to return
!b,@b,23,45,223,664,672,mansion . This is the 100000000000000 bug in this piece of **** language.
The ASCII value of '@' is 64, which is the highest value for the first characters in all of the elements in your array and why JavaScript puts it last.
The ASCII value of '@' is 64, which is the highest value for the first characters in all of the elements in your array and why JavaScript puts it last.
I need to sort values like system sorts files, not some non standard ASC|| bull****. If I create files and sort them by name, '@' file will stand before any numerically named file. Check the picture. http://img191.imageshack.us/img191/6131/sortl.jpg @b file stands before 23.
If you don't like the default sorting function in JavaScript as defined in the standard, provide your own sorting function. That's why sort accepts a function! And as you seem to be unaware or uninterested, Windows does not have one consistent sorting order, in fact, it has an apparantly "intuitive sort" occasionaly. And why would you expect someone to help you when you constantly complain about the language? It's difficult enough to use a language that has multiple definitions on multiple platforms without complaining about what is implemented correctly!
BTW, you haven't even discovered all the "bugs" yet!
Last edited by Declan1991; 10-22-2011 at 01:46 PM.
Great wit and madness are near allied, and fine a line their bounds divide.
You can always build your own sorting function; there are several popular methods. I tend to use two arrays and loop through (the first) to find the max or min (adding it to the second) until all entires have moved from one (the first) to another (the second).
Bookmarks