📅  最后修改于: 2022-03-11 15:03:01.153000             🧑  作者: Mango
javascript sort object by value descending
starWarsPeople.map(e=>{
return e
}).sort((a,b)=>{
if (a.height-b.height>1) {return -1;}
else if (a.height-b.height<1) {return 1;}
else {return 0;}
});