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

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **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

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | arrayName | Array | Yes | Array to be converted to a set of elements. |

## Return Type

**Array**

## Example

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

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

## See also

> Macro (contentbylabel)