So I have come to find that I like the lodash _.sortBy method more so than the native Array.prototype.sort method for a few various reasons. I do still use it of course when it comes to working with a project where lodash is not part of the stack, it is just that the method works in a way that I find more natural when it comes to the return value and arguments used for the function that is passed to the sort by method. I will be elaborating what I mean by that in this post.
The _.sortBy method is another option compared to the _.find method also, the _.find method can be used to find just one item in a collection, while the _.sortBy method can be used to sort the whole collection, I can then take just the first element, or the top three. So lets take a look at some examples of sorting with lodash, and native javaScript as well.
Read More