Sorts an array in place. This method mutates the array and returns a reference to the same array.
Function used to determine the order of the elements. It is expected to return a comparable value for this item to sort upon.
[{size: 11, name: 'John'}, {size: 22, name: 'Max'}].sortBy(obj => obj.name) Copy
[{size: 11, name: 'John'}, {size: 22, name: 'Max'}].sortBy(obj => obj.name)
list (sorting in place)
Sorts an array in place. This method mutates the array and returns a reference to the same array.