Guest practice: this set is not saved and does not count.
What does this log?
const s = new Set([10, 20, 30]); console.log(s[0], s.length, s.size);
const a = new Set([1, 2, 3]); const b = new Set([3, 4]); console.log([...a.union(b)], [...a.intersection(b)]);
const a = new Set([1, 2, 3]); const b = new Set([2, 3, 4]); console.log([...a.difference(b)], [...b.difference(a)]);
const a = new Set([1, 2, 3]); const b = new Set([3, 4]); console.log([...a.symmetricDifference(b)]);
const ws = new WeakSet(); const o = {}; ws.add(o); console.log(ws.has(o), ws.has({}), ws.size);
Click a question to go back and check it. After you submit, you will see the right answer and an explanation for every question. As a guest, nothing is saved.
Check my answers