Immutable persistent set for the browser and node.js
$ npm install @nathanfaucett/immutable-set --save
$ yarn add @nathanfaucett/immutable-set --save
var ImmutableSet = require("@nathanfaucett/immutable-set");;
var a = new ImmutableSet([0, 1]),
b = new ImmutableSet(0, 1),
c = ImmutableSet.of([0, 1]),
d = ImmutableSet.of(0, 1);
var a0 = a.set(2),
a1 = a.remove(1);
returns size of Set, only available if Object.defineProperty is supported
returns true if value is a set else false
creates Set from passed values same as new Set(...values: Array<Any>)
compares sets by values
returns size of Set
returns value
returns true if set contains value
returns new Set if value is not in Set
returns new Set without the value
returns Iterator
returns Set elements in an Array
join all elements of an Set into a String
String representation of Set
compares this set to other set by values
common Array methods