lodash orderby with null and real values not ordering correctly

后端 未结 6 807

I have an Angular 2 typescript application that is using lodash for various things.

I have an array of objects that I am ordering using a property in the object...

6条回答
  •  既然无缘
    2021-01-07 22:52

    The code I needed looks like this...

    _.orderBy(this.myArray, [( o ) => { return o.myProperty || ''}], ['desc']); 
    

提交回复
热议问题