
npm install proposal-set
bash
npm install proposal-set
`
Description
An expanded javascript and typescript set that has all current set proposals with type information and
intellisense explanations. Works in node and in the browser. Stop reinventing the wheel
and start using extremely elegant, concise, and performant set operations. As a shim it will test if there's
a native implementation and use that first—so this package won't become an issue in the future.
The underlying shim (es-shims) is robust and well tested but doesn't
have everything grouped together in one place.
Use
`typescript
import pSet from "proposal-set";
const x = new pSet([1, 2, 3]);
const y = new pSet([1, 2]);
console.log(x.difference(y));
// => Set(1) { 3 }
console.log(x.intersection(y));
// => Set(2) { 1, 2 }
console.log(x.union(y));
// => Set(3) { 1, 2, 3 }
``