1 // |reftest| skip -- set-methods is not supported
2 // Copyright (C) 2023 Anthony Frehner and Kevin Gibbons. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 esid: sec-set.prototype.symmetricdifference
6 description: Set.prototype.symmetricDifference can combine Sets that have the same content
7 features: [set-methods]
8 includes: [compareArray.js]
11 const s1 = new Set([1, 2]);
12 const s2 = new Set([1, 2]);
14 const combined = s1.symmetricDifference(s2);
16 assert.compareArray([...combined], expected);
17 assert.sameValue(combined instanceof Set, true, "The returned object is a Set");
18 assert.sameValue(combined === s1, false, "The returned object is a new object");
19 assert.sameValue(combined === s2, false, "The returned object is a new object");