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

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

## Description

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

Sorts the elements from an array.

## Parameters

> Macro (table-plus)
> 
> | 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 routine is an array that contains the elements from watchers sorted in the ascending order.

## See also

> Macro (contentbylabel)