Module: utils/array/createByPropertySorter

Methods

(static) createByPropertySorter(prop, descendingopt) → {function}

Creates a sort callback for Array.prototype.sort that allows to sort objects by the values found under the given property name.

Parameters:
Name Type Attributes Description
prop string

the name of the property for which to sort

descending boolean <optional>

optional flag to sort descending if true

Source:
Returns:
Type
function