showing results for - "sorted union freecodecamp"
Iliana
29 Nov 2016
1function uniteUnique(arr) {
2  let newArr = arr;
3  
4  for ( let i = 0; i < arguments.length; i++ ) {
5
6    arguments[i].forEach( function( value ) {
7
8      if ( arr.indexOf( value ) < 0 ) {
9        newArr.push(value);
10      }
11      
12    } );
13    
14  }
15
16  return newArr;
17
18
19}
20
21uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8])