set-simplified-js
v1.0.5
Published
Set implementation with some extra utils
Downloads
4
Maintainers
Readme
set-js
import { Set, SetExtended } from 'set-js';
SetExtended Methods
SetExtended can be used for union and intersection only. In the form
const unionResult = SetExtended.union(s1, s2); const intersectionResult = SetExtended.intersection(s1, s2)
Set Methods
const set = new Set(params); set.add(params); set.has(params); set.delete(params); set.clear(); set.size;
const unionArr = set1.union(set2); const intersectArr = set1.intersection(set2);
params can be ->
- array -> [1,2,3]
- single_element -> 3
- elements_comma_separated -> 1,2,3
Methods implemention
- How to initiate