Child class

new _Set(iterable)

Creates a new set. Can also be done with constructors.S.

Parameter

Name Type Optional Description

iterable

 

 

Optional iterable to initialize the set with

Extends
Set
Returns

Class

Methods

clone() → _Set

Makes a copy of the set

Returns

_Set 

diff(other) → _Set

Creates set difference in place with other and returns this set

Example

S([1, 2, 3]).diff(S([3, 4, 5])) // { 1, 2 }

Parameter

Name Type Optional Description

other

_Set

 

Returns

_Set 

intersect(other) → _Set

Creates set intersection in place with other and returns this set

Example

S([1, 2, 3]).intersect(S([3, 4, 5])) // { 3 }

Parameter

Name Type Optional Description

other

_Set

 

Returns

_Set 

symdiff(other) → _Set

Creates symmetric set difference in place with other and returns this set

Example

S([1, 2, 3]).symdiff(S([3, 4, 5])) // { 1, 2, 4, 5 }

Parameter

Name Type Optional Description

other

_Set

 

Returns

_Set 

union(other) → _Set

Creates set union in place with other and returns this set

Example

S([1, 2, 3]).union(S([3, 4, 5])) // { 1, 2, 3, 4, 5 }

Parameter

Name Type Optional Description

other

_Set

 

Returns

_Set