Hello campers ,please can any one explain to me what I am missing here , I didn’t understand this challenge very well
function Set() {
// to see all methodes inside the Set constructor visit the link below
// change code below this line
this.union=function(arr){
for(let i=0;i<arr.length;i++){
this.add(arr[i]);
}
return collection;
}
// change code above this line
}
let obj1=new Set();
obj1.add(1);
obj1.add(2);
obj1.add(3);
console.log(obj1.values());
console.log(obj1.union([2,4,5])) // this works the output is [1,2,3,4,5] 2 is not repeated
https://learn.freecodecamp.org/coding-interview-prep/data-structures/perform-a-union-on-two-sets
they said that This method should take another Set
what is the meaning of this
is this means that I can create an instance of constructor within it