1 | 'use strict';
|
2 | var aSet = require('../internals/a-set');
|
3 | var add = require('../internals/set-helpers').add;
|
4 | var clone = require('../internals/set-clone');
|
5 | var getSetRecord = require('../internals/get-set-record');
|
6 | var iterateSimple = require('../internals/iterate-simple');
|
7 |
|
8 |
|
9 |
|
10 | module.exports = function union(other) {
|
11 | var O = aSet(this);
|
12 | var keysIter = getSetRecord(other).getIterator();
|
13 | var result = clone(O);
|
14 | iterateSimple(keysIter, function (it) {
|
15 | add(result, it);
|
16 | });
|
17 | return result;
|
18 | };
|