toArray()

Convert a Set to an Array.

Signature

toArray(): Array

Description

The toArray() method converts the set to an Array.

The source set isn’t changed.

Parameters

None

Return value

Type Description

Array

Array representation of the set instance.

Examples

[1, 2].toSet().toArray()
[
  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!