---
title: "arraySort"
canonical: "https://support.appfire.com/space/PSJC/434733352/arraySort"
format: markdown
---
> Macro (aura-html)


## Description

> Macro (excerpt)
> 
> Sorts the elements from an array.

Sorts the elements from an array.

|  |  |  |  |
| --- | --- | --- | --- |
| **Syntax** | arraySort(arrayName, reverse) | **Package** | array |
| **Alias** |  | **Pkg Usage** | sort(arrayName, reverse) |

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| arrayName | Array | Yes | Array. |
| reverse | Boolean | Yes | "True" if reverse order and "false" otherwise. |

## Return Type

**Array**

## Example

```javascript
watchers = arraySort(watchers, false);
```

The result returned by the function is an array that contains the elements from watchers sorted in the ascending order.

## See also

> Macro (contentbylabel)