@extra-set/union-bang

Gets union of set with an iterable. > This is part of package extra-set.

Usage no npm install needed!

<script type="module">
  import extraSetUnionBang from 'https://cdn.skypack.dev/@extra-set/union-bang';
</script>

README

Gets union of set with an iterable.

This is part of package extra-set.

const unionTo = require('@extra-set/union');
// unionTo(<set1>, <set2>, [target=new Set()])

var a = new Set('call');
var b = new Set('fall');
unionTo(a, b);
// Set {'c', 'a', 'l', 'f'}
unionTo(a, b, a);
// Set {'c', 'a', 'l', 'f'} (set "a" modified)
unionTo(a, b, b);
// Set {'f', 'a', 'l', 'c'} (set "b" modified)

extra-set