How about using a ternary expression here?

```javascript
return selector ? ... : [];
```