---
title: "arrayToSet"
canonical: "https://support.appfire.com/space/PSJ/15489424/arrayToSet"
format: markdown
---
> Macro (aura-html)


|  |  |  |  |
| --- | --- | --- | --- |
| **Syntax** | arrayToSet(arrayName) | **Package** | array |
| **Alias** |  | **Pkg Usage** | toSet(arrayName) |

## Description

> Macro (excerpt)
> 
> Converts an array to a set of unique elements.

Converts an array to a set of unique elements.

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| arrayName | Array | Yes | Array to be converted to a set of elements. |

## Return Type

**Array**

## Example

```
watchers = arrayToSet(watchers);
```

The result returned by the function is an array that contains the elements from watchers without duplicates.

## See also

> Macro (contentbylabel)