Collect.js sortBy() Method
The sortBy() method is used to sort the collection by the given key. Syntax: collect.sortBy() Parameters: The collect() method takes one argument that is converted into the collection and then sortBy() method is applied on it. Return Value: This method return the collection after sorting by the give