The old school way of adding all values of an array into the Set is:
// for the sake of this example imagine this set was created somewhere else // and I ca
While Set API is still very minimalistic, you can use Array.prototype.forEach and shorten your code a bit:
Set
array.forEach(item => mySet.add(item)) // alternative, without anonymous arrow function array.forEach(mySet.add, mySet)