---
title: "arrayKeySort"
canonical: "https://support.appfire.com/space/PSCONF/15302875/arrayKeySort"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | arrayKeySort(arr) | **Package** | array |
> | **Alias** |  | **Pkg Usage** | keySort(arr) |

## Description

> Macro (excerpt)
> 
> Sorts the elements from an array by their keys. Works with keyed arrays only.

Sorts the elements from an array by their keys. Works with keyed arrays only.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | arr | Array | Yes | Array, must have keys. |

## Return Type

**Array**

## See also

> Macro (contentbylabel)