diff --git a/Javascript Algorithms And Data Structures Certification/Intermediate Algorithm Scripting/10-sorted-union.js b/Javascript Algorithms And Data Structures Certification/Intermediate Algorithm Scripting/10-sorted-union.js index 894fc02..5aac179 100644 --- a/Javascript Algorithms And Data Structures Certification/Intermediate Algorithm Scripting/10-sorted-union.js +++ b/Javascript Algorithms And Data Structures Certification/Intermediate Algorithm Scripting/10-sorted-union.js @@ -1,12 +1,13 @@ function uniteUnique(...arr) { - let result=[]; - arr.forEach(x=>{ - x.forEach(y=>{ - if(!result.includes(y)) // other way result.indexOf(y)==-1 - result.push(y); - }); - }); - return result; + for(let i=1;i