function unite(arr1, arr2, arr3) {//1
var tdc = [];
for(h = 0; h < arguments.length; h ++) {//2
//console.log("h ", h);
//console.log("arguments[h]", arguments[h]);
tdc = tdc.concat(arguments[h]);
}//2c
console.log("tdc", tdc);
for(i = tdc.length - 1; i > 0; i --) {//2
for(j = i -1; j > -1; j --) {//3
if(tdc[j] === tdc[i]) {//4
tdc.splice(i, 1);
console.log("tdc spliced", tdc);
}//4c
}//3c
}//2c
return tdc;
}//1c
unite([1, 2, 3], [5, 2, 1], [2, 1]);
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.