I am trying to sort object array according to the points. In response, I am getting as shown in below image.
I want it to start from highest points_earned
to lowest. For now it start with 50 and end with 1000. I want it to be start from 1000 and end with 50.
I have tried with the following code but doesn't seem working. Please help.
var homes = response.response.conversion_summary_stats;
console.log(homes);
homes.sort(function(a,b) { return a.points_earned.valueOf() < b.points_earned.valueOf();});
console.log(homes);