function uniteUnique(arr) {
let arrNumbers = [];
let newArray = [];
for(let i=0;i<arguments.length;i++){
for(let j=0;j<arguments[i].length;j++){
arrNumbers.push(arguments[i][j]);
}
}
for(let i=0;i<arrNumbers.length;i++){
(newArray.indexOf(arrNumbers[i]) == -1) ?
newArray.push(arrNumbers[i]) : false;
}
return newArray;
}
console.log(uniteUnique([1, 3, 2, 3], [5, 2, 1, 4], [2, 1]));
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)