Sorted Union - Doubt with my code

Tell us what’s happening:

Can someone tell why this console.log() printed in the console the sorted array (The one the challenge asked) even though it’s at the beginning and it should’ve printed the parameters given (The last line of my code), and why the push function adds it as if it were a new array and not to the array given as a parameter.
??? I’m very confused

Your code so far

  console.log(arr);
  //var arr2 = [];
  for(var i=0; i<arguments.length; i++){
    for(var j=0; j<arguments[i].length; j++){
      if(!arr.includes(arguments[i][j])){
        arr.push(arguments[i][j]);
      } 
    }
  }
  return arr;
}

//uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
uniteUnique([1, 3, 2], [1, [5]], [2, [4]]);```
**Your browser information:**

Your Browser User Agent is: ```Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36```.

**Link to the challenge:**
https://www.freecodecamp.org/challenges/sorted-union

Sorry, Here it is:

function uniteUnique(arr) {
  console.log(arr);
  //var arr2 = [];
  for(var i=0; i<arguments.length; i++){
    for(var j=0; j<arguments[i].length; j++){
      if(!arr.includes(arguments[i][j])){
        arr.push(arguments[i][j]);
      } 
    }
  }
  return arr;
}

//uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
uniteUnique([1, 3, 2], [1, [5]], [2, [4]]);