toSet()

Convert a Array to an Set.

Signature

toSet(): Set

Description

The toSet() method converts the array instance to a Set.

The source array isn’t changed.

Parameters

None

Return value

Type Description

Set

Set representation of the array instance.

Examples

[1, 2].toSet()
{
  "data": [
    1,
    2
  ]
}

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!