I’m trying to condense the arrays into one singular array. Next I extract the values from the array omitting any repeats. However when using the set object I’m left with the error (ReferenceError: set is not defined). Any help would be greatly appreciated.
**Your code so far**
function uniteUnique(arr) {
const singularity = arr.flat(Infinity);
for(let i = 0; i < singularity.length; i++){
new set(singularity);
}
}
uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36