set.concat()

Concatenate two Sets.

Loading strategy:

Signature

concat(other: Set<B>) => Set<A | B>

Description

Creates a Set by copying the calling Set to a new Set and appending another Set.

The calling Set and the other Set aren’t changed.

Parameters

Parameter Type Required Description

other

Set<Generic>

Yes

Set to append to the calling Set.

Return value

Type Description

Set<Generic>

New Set composed of the concatenated Sets.

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!