Iterate over nth amount of indexes in an array of objects : <p>i am trying to return the sum of the <strong>first 4</strong> grid values from the object below (expected output <strong>5</strong>)</p>

<pre><code>[
  {
    "id": 1,
    "grid": 1
  },
  {
    "id": 2,
    "grid": 2
  },
  {
    "id": 3,
    "grid": 1
  },
  {
    "id": 4,
    "grid": 1
  },
  {
    "id": 5,
    "grid": 1
  }
]



data.map(item =&gt; {
   console.log(item.grid);
});
</code></pre>

<p>Relatively new with .map, I would usually use a forwhile iterator but wondered if someone could suggest a more es6 style pattern for solving the problem.</p>
