I have an array with multiple numbers, these numbers are positive, negative and with decimal too:
var array = [365, -1.304, -17.803, -3.529, -3.602, -2.942, -2.074, -115]
I need to sort this array from MINOR to the LARGEST . The result you would expect is:
[-17.803, -3.602, -3.529, -2.942, -2.074, -1.304, -115, 365]
But instead this is coming out:
[-115, -17.803, -3.602, -3.529, -2.942, -2.074, -1.304, 365]
The code I'm using to sort:
GraphOne[Regional].sort(function(a,b){return a > b});