2021-05-02

JavaScript - Underscore sort array of objects based on multiple fields

_(your_array).sortBy(

    function(elem) {

       return [elem.field_to_sort_by_1, elem.field_to_sort_by_1];

    }

);


No comments:

Post a Comment