Group by date and count average in JS : <p>I have a dataset with the timestamp and some params. It looks like that: </p>

<pre><code>const resp = [
    {date: 1576098000, responseBot: 0.47, responseManager: 2.0},
    {date: 1576098000, responseBot: 1.50, responseManager: null},
    {date: 1576098000, responseBot: 1.05, responseManager: 2.3},
    {date: 1576108800, responseBot: 1.00, responseManager: 3.3},
    {date: 1576108800, responseBot: 0.60, responseManager: 1.5},
]
...
</code></pre>

<p>I need to get a grouped result (by date) and count an average of response (bot and manager). Expected result: </p>

<pre><code>[
    {date: 1576098000, responseBotAvg: 1.006, responseManagerAvg: 2.15},
    {date: 1576108800, responseBotAvg: 0.8, responseManagerAvg: 2.4}
]
</code></pre>

<p>What is the best way to achieve this result in pure javascript? </p>
