Exerpad
Exercise 9 · Chapter: SetsOptional+50 XP

Fix the Union

This program tries to combine two sets with +, which doesn't work on sets. Fix it!

Expected output:

5
Need a hint?
3 available · costs 5 XP each
javascript
let a = new Set([1, 2, 3]);
let b = new Set([3, 4, 5]);
let combined = a + b;
console.log(combined.size);
Output
Run your code to see the output here.