Function sort_objects_by_property

  • Sort array of objects by property NOTE: this is just like _.sortBy() but can only sort by one property instead of multiple This is simply a simplified copy of sort_objects_by_property_and_position() Like sort_objects_by_property_and_position(), but without caring about the position.

    Returns

    • array of objects, sorted

    Parameters

    • arr: Record<any, any>[]

      array of objects to be sorted

    • prop1_key: any

      property to use, to sort by. Each object in array must contain this key

    • prop1_desc: boolean = false

      {boolean} - by default, will sort ASC, but if this is true, will sort DESC

    Returns Record<any, any>[]

Generated using TypeDoc