我正在使用v4.11.0.
我想基于毫秒属性对对象进行排序.
这是阵列:
我想基于毫秒属性对对象进行排序.
这是阵列:
[ { "name": "bug12755.xml","list": "bugs42","start-date": "2015-09-14","age": { "text": "7 months","milliseconds": 18381227304 } },{ "name": "bug12922.xml","start-date": "2015-08-27","age": { "text": "8 months","milliseconds": 19936427304 } },{ "name": "bug13183.xml","list": "bugs50","milliseconds": 19936427305 } } ]
我遗漏了一些关于iteratee函数的基本知识.我有这个,但似乎没有排序数组.提前致谢!
_.orderBy(list,function(item) { return item.age.value; },['desc']);
解决方法
您似乎按物业价值排序.
u.orderBy(list,function(e) { return e.age.milliseconds},['desc']);