JSchallenger

Get union of two sets

Viewed: 379
Attempted: 48
Solved: 15
// Write a function that takes two Sets as arguments
// Create the union of the two sets
// Return the result
// Tipp: try not to switch to Arrays, this would slow down your code

function myFunction() {

return
}
Test Cases:
myFunction(new Set('123'), new Set('234'))
Expected
new Set('1234')
myFunction(new Set([1, 2, 3]), new Set([3, 4, 5]))
Expected
new Set([1, 2, 3, 4, 5])
myFunction(new Set([false, false, NaN]), new Set([true, true, NaN]))
Expected
new Set([false, NaN, true])