set.concat()

Create an Set by concatenating two Sets.

Lazy loading:

Yes

Signature

concat(otherSet: Set) => Set

Description

The concat() method creates an Set by copying the calling Set to a new Set and appending otherSet.

the calling Set and otherSet aren’t changed.

Parameters

Parameter Type Required Description

otherSet

Set

Yes

Set to append to the calling Set.

Return value

Type Description

Set

New Set composed of otherSet appended to the calling Set.

Examples

// `toSet()` converts an Array to a Set.
let setA = [1, 2, 3].toSet()
let setB = [4, 5, 6].toSet()

setA.concat(setB)
{
  data: [
    1,
    2,
    3,
    4,
    5,
    6
  ]
}

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!