It adds an extra level of abstraction to reverse the logic since it has to work either way. This is simpler:

```
    var prefixes = Array.isArray(prefix) ? prefix : [prefix];
```