Since Javascript doesn\'t have a built in set datatype has anyone come across a decent library for sets and set operations like union, intersection, etc?
immutable-js expose a powerfull set data-structure.
A simple example for node.js, which you can see in work here.
im = require("immutable")
const mySet = im.Set([1, "a", {value: Symbol()}])
// the .add and .delete methods do not modify mySet, but return a new set instance instead.
const newSet = mySet
.add(42)
.delete(1)
console.info("Does mySet have 42?", mySet.has(42))
console.info("Does newSet have 42?", newSet.has(42))