`var indexes = [];` here

and then at the end
```
if (indexes.length) {
  allMatches.push(indexes)
}
```

what do you think?