Hi together
I passed the Intermediate Algorithm Task “Sorted Union” with the code below.
Is this a good, intermediate or bad solution? Please rate my code and give me some feedback.
Thx.
function uniteUnique(arr) {
let result = [];
[...arguments].flat().forEach(el => { if (!(el in result)) result.push(el) });
return result;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0.