source: imaps-frontend/node_modules/core-js/internals/set-symmetric-difference.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 740 bytes
Line 
1'use strict';
2var aSet = require('../internals/a-set');
3var SetHelpers = require('../internals/set-helpers');
4var clone = require('../internals/set-clone');
5var getSetRecord = require('../internals/get-set-record');
6var iterateSimple = require('../internals/iterate-simple');
7
8var add = SetHelpers.add;
9var has = SetHelpers.has;
10var remove = SetHelpers.remove;
11
12// `Set.prototype.symmetricDifference` method
13// https://github.com/tc39/proposal-set-methods
14module.exports = function symmetricDifference(other) {
15 var O = aSet(this);
16 var keysIter = getSetRecord(other).getIterator();
17 var result = clone(O);
18 iterateSimple(keysIter, function (e) {
19 if (has(O, e)) remove(result, e);
20 else add(result, e);
21 });
22 return result;
23};
Note: See TracBrowser for help on using the repository browser.