# Day 4: Count Objects

### Problem Link <a href="#problem" id="problem"></a>

* [x] [**HackerRank Problem Link**](https://www.hackerrank.com/challenges/js10-count-objects/problem)

### Solution

* [x] **JS Solution**

{% code title="countObject.js" %}

```javascript
let pairCount = 0;
  for (let i = 0; i < objects.length; i++) {
    if (objects[i].x === objects[i].y) {
      pairCount++;
    }
  }
  return pairCount;
```

{% endcode %}
