sorted union freecodecamp
function uniteUnique(arr) {
let newArr = arr;
for ( let i = 0; i < arguments.length; i++ ) {
arguments[i].forEach( function( value ) {
if ( arr.indexOf( value ) < 0 ) {
newArr.push(value);
}
} );
}
return newArr;
}
uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8])