JSchallenger

Add multiple elements to Set

Viewed: 239
Attempted: 17
Solved: 5
// Write a function that takes a Set and an array as arguments
// If not already existing, add each element in the array to the Set
// Return the modified Set

function myFunction() {

return
}
Test Cases:
myFunction(new Set([1, 2, 3]), [4, 5, 6])
Expected
new Set([1, 2, 3, 4, 5, 6 ])
myFunction(new Set('12345'), [...'6789'])
Expected
new Set([...'123456789'])
myFunction(new Set([1, 2, 3]), [2, 3])
Expected
new Set([1, 2, 3])