Question: i have a very long array of points like so: 

```
        latlngs: [
      [3.063895, 50.636767],
      [3.06339, 50.637233],
      [3.063309, 50.637278],
      [3.063254, 50.637288],
      [3.063103, 50.637267],
      [3.061939, 50.636762],
      [3.059679, 50.635821],
      [3.056687, 50.634532],
      [3.067972, 50.628265],
      [3.068189, 50.628169],
      [3.068389, 50.628159],
      [3.06959, 50.628201],
      [3.075613, 50.629068],
      [3.077604, 50.629383],...
      // 4500 array more
      ]

```

And i would like to loop on one on n element on it to make the computation less intensive. For example i would like to loop on 1 on 6 elements. What would be the best way to do that ?

Answer: 
A simple `for` loop is enough

```
for (let index = 0; index < latlngs.length; index+= 6) {

  // do whatever computation you need with latlngs[index]

}

```
an alternative to the for loop with 6 increment can be the usage of modulo

```
latlngs.forEach((x, i) => {
  // cbk + return in case of modulo !== 0 is negligible
  // in regards to doyourstuff
  if (i % 6 !== 0) { return }
  doyourstuff
})

```