main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function sym(args) {

  args = [...arguments];
  var whole = [], arr1, arr2, unique;
  
  while(args.length > 0) {
    
    arr1 = [...new Set(args.shift())];
    arr2 = [...new Set(args.shift())];
    
    whole = arr1.concat(arr2);
    unique = whole.filter( (val) => whole.indexOf(val) === whole.lastIndexOf(val) );
    
    if(args.length > 0)
        args.push(unique);
    else
      return unique;
      
  }
    
}


sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]);
Native Browser JavaScript