I suppose it depends on how it’s implemented. I’d love it if someone would come back and tell me ‘yes, in virtually all browsers, order of items will be changed only when necessary to satisfy the conditions of the sort.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What you’re looking for is whether or not the algorithm is ‘stable’. It is known that Firefox’s is not, while IE’s is. The javascript standard doesn’t require a stable sorting algorithm.
Edit: Firefox 3+ has a stable sort. Please see http://www.hedgerwow.com/360/dhtml/js_array_stable_sort.html