JSchallenger

Delete element from Set

Viewed: 165
Attempted: 26
Solved: 9
// Write a function that takes a Set and a value as argument
// If existing in the Set, remove the value from the Set
// Return the result

function myFunction() {

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