> ## Documentation Index
> Fetch the complete documentation index at: https://kk-83bff226.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# sortByProperty

> Sorts an array of objects based on a specified property.

## Signature

```typescript path=null start=null theme={null}
sortByProperty<T extends { [key: string]: string | number }>(
  arr: T[],
  prop: string,
): T[]
```

## Type Parameters

* **T** extends `{ [key: string]: string | number }` - The type of the objects in the array.

## Parameters

* **arr**: `T[]` - The array to sort.
* **prop**: `string` - The property to sort by.

## Returns

`T[]` - The sorted array.

## Source

Defined in [object.ts:31](https://github.com/koji/ichigyou/blob/main/src/object.ts#L31)
