Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.2.0 Beta1
-
None
Description
Sorting a javascript array with a custom sorting function give a wrong result:
Test code :
var array = [] array.push({name:"a", value:0}) array.push({name:"b", value:0}) array.sort(function(a,b) { return a.value - b.value }) print(array[0].name + "," + array[1].name)
Expected result is: "a,b"
Result is : "b,a"