Question: I switch panes often and when I press ctrl-a-right I move the the right. Then if I start typing "vim", the 'v' causes a ctrl-a-v (split vertically) to be issued, but I don't want this. How do I make tmux realize this?

Answer: 
You can use `array#reduce` to flatten your array and then use `Set` to get distinct values and use `array#from` to get back array from `Set`.

```js
var a = [1,2,3,4,5];
var b = [1,2,7,8];
var c = [1,2,3,4,5,6,7,8];
var d = [9,10,11,12];
var arr = [a,b,c,d]

var result = Array.from(new Set(arr.reduce((r,a) => r.concat(a))));
console.log(result);
```
Here is a solution that uses a plain object for resolving duplicates, and only uses basic ES3 JavaScript. Runs in IE 5.5 and higher, and with *O(n)* time complexity.

```js
function uniques(arr) {
    var obj = {}, result = [];
    for (var i = 0; i < arr.length; i++) {
        obj[arr[i]] = true;
    }
    for (var prop in obj) {
        if (obj.hasOwnProperty(prop)) result.push(+prop);
    }
    return result;
}

// Example use
var a = [1,2,3,4,5], 
    b = [1,2,7,8],
    c = [1,2,3,4,5,6,7,8],
    d = [9,10,11,12];

var result = uniques(a.concat(b, c, d));

console.log('Result: ' + result);
```

As an object can only have a unique set of properties (no duplicates), the use of all array values as properties in an object will give you an object with a property for each unique value. This happens in the first loop. NB: the value given to those properties is not relevant; I have used `true`. 

Then the result is just the conversion of those properties back to array values. This happens in the second loop.