use the classic solution. Get a hash (in javascript is a normal associative array), the keys of which are the elements of the array, and the values are the number of repetitions. Then we go over each array and if there is no in the hash, add the key and the value 1. If the key is already there, increase the value by 1.
Now, look for those keys in the hash, where the value is one. These will be unique values. This method is fast and hardly exists faster (in any case, you need to see all the elements of the array).
This method can be improved. For the elements of the first array we increase by 1, and for the second by 2. Then in the hash for unique values there will be either 1 or 2 (we immediately know where) and 3 for common elements. But if there are duplicate elements in the arrays, then there may be a bjaka. But it is solved very simply - you need to take not 1 and 2, but 1 and 1,000,000. And if there are less than a million repetitions - everything is ok.
The method described by @TheDoctor is simple, but for large arrays it will be more blunt (because it has quadratic complexity).
There is another way, which is to first sort the arrays, and then organize a "parallel pass" in two arrays. Coded a little difficult, but interesting.