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: 
Try using .filter when adding each array to the final one, filtering out the duplicates:

```
a.filter(function(item) {
    return !finalArray.contains(item));
});

```
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)