Set.fromKeys()
creates a new immutable Set containing the keys from
this Collection or JavaScript Object.
Set.intersect()
creates a new immutable Set that is the intersection of
a collection of other sets.
const { Set } = require('immutable')
const intersected = Set.intersect([
Set([ 'a', 'b', 'c' ])
Set([ 'c', 'a', 't' ])
])
// Set [ "a", "c" ]
True if the provided value is a Set
Creates a new Set containing values
.
Set.union()
creates a new immutable Set that is the union of a
collection of other sets.
const { Set } = require('immutable')
const unioned = Set.union([
Set([ 'a', 'b', 'c' ])
Set([ 'c', 'a', 't' ])
])
// Set [ "a", "b", "c", "t" ]
Generated using TypeDoc
A Collection of unique values with
O(log32 N)
adds and has.When iterating a Set, the entries will be (value, value) pairs. Iteration order of a Set is undefined, however is stable. Multiple iterations of the same Set will iterate in the same order.
Set values, like Map keys, may be of any type. Equality is determined using
Immutable.is
, enabling Sets to uniquely include other Immutable collections, custom value types, and NaN.