sortBy

sortBy function able to sort array of object order with array.sort compare function by key.

Example

Params
paramDescriptionTypeDefault
fieldkey of the object that target to sortstring-
reverseOrder of the result, true for descending, false for ascendingboolean-
primerCallback closure for key(key: string) => (key) => void-
Return
returnDescriptionTypeDefault
resultSort result callback(a, b) => boolean-