title: Group and count the occurances using angular ts
body: <p>I have this kind of data <img src="https://i.stack.imgur.com/iXHGh.png" alt="Date Time Format" /></p>
  <p>How do I filter it and count it. The result that I'm trying to get is as follows:</p>
  <p>Oct : 2
  Nov : 3</p>
  <p>This is the code that i have been trying</p>
  <pre><code>let data = new Set(this.products.map(item =&gt; item.date))
  data.forEach((date)=&gt;{
       this.resultData.push({
          date: date, 
          products: this.products.filter(i =&gt; i.date === date)
        })
  })
  </code></pre>
  <p>should i just change to normal js for loop or using ts foreach loop?</p>