Zet

zet

Set() as it should be.

zet is an extension of ES6 Set and comes with all its functionality included along with the below:

  • ∪ union
  • ∩ intersection
    • difference/subtract
  • ⊖ symmetric difference
  • ⊆ subset
  • ⊇ superse

Get it: npm install zet

Sample usage:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const Zet = require('zet');

let a = new Zet([1, 2, 3]);
let b = new Zet([3, 4, 5]);
let c = new Zet([2, 3, 4]);

Zet.union(a, b);
//=> [Zet] {1, 2, 3, 4, 5}

a.union(b, c);
//=> [Zet] {1, 2, 3, 4, 5}

a.intersection(b);
//=> [Zet] {3}

a.symmetricDifference(c);
//=> [Zet] {1, 4}

a.subset(b);
//=> false

GIT FTW!

zet

Suggest a module

Comments