I am attempting to arrange the objects inside an array below in ascending order by their values and achieve the desired output as shown:
var arr = [{"DOA Qty":"0.000665921017598927382910198160","LOS%":"0","FID Valid EC By Part":"0.0041860443283016713761966","Interventions":"0"}]
Desired output - sorted in ascending order by value:
var desiredarr =[{"LOS%":"0","Interventions":"0","DOA Qty":"0.000665921017598927382910198160","FID Valid EC By Part":"0.0041860443283016713761966"}]
let sorteddataarr: any = Object.values(arr[0]).sort(function (a, b) { return arr[a] - arr[b]; });
alert(JSON.stringify(sorteddataarr)); // not displaying the expected result