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);
```
Becuase the OP mentioned that he cannot use 'Set' as it is not supported on the targeted browsers, I would recommand using the `'union'` function from the lodash library.

[See union's documentation here](https://lodash.com/docs/4.17.4#union)