标签:javascrip rip code java else script 属性 color count
function compare(property,desc) { return function (a, b) { var value1 = a[property]; var value2 = b[property]; if(desc==true){ // 升序排列 return value1 - value2; }else{ // 降序排列 return value2 - value1; } } }
data3curr.sort(compare(‘carCount‘, true))
标签:javascrip rip code java else script 属性 color count
原文地址:https://www.cnblogs.com/xhrr/p/13613499.html