I am kinda new to javascript and today I encountered problem. Thing is, I have an array of amount of people visited every day by each hour (as you can see bellow). And I would like to find out most popular hour of day. My plan was to create a map where key is index of hour (0, 1, 2, 3, 4, 5...) and value is sum of all people who visited across all days on that hour. Problem is I'm not able to do that with my JS knowledge. Can someone give me a direction how to approach this problem? Thank you very much.

```
[
   {date: "25.05.2018",
     value: {
       1: 209
       2: 123
       3: 890
       .
       .
       24: 789
     }
    }, 
    {date: "26.05.2018",
     value: {
       1: 280
       2: 398
       3: 450
       .
       .
       24: 76
     }
    } 
 ]

```

My JAVA like solution:

```
const { data: { data: [{ values }] } } = insightsData;

  const timesMap = new Map();

  values.forEach(item => {
    Object.entries(item.value).forEach(([key, value]) => {
      const timeValue = timesMap.get(key);
      if (timeValue) {
        timesMap.set(key, timeValue + value);
      } else {
        timesMap.set(key, value);
      }
    });
  });

```