A good way for it to look might be: 
```
matchData.getMatches().then(function(matches) {
  matchedData = matchData.getMatches();
  counter = matchedData.length;
}
```

This would also get rid of the need for getCount.