I need to create an array with all endpoints of all lines in my SVG.

For this, I thought to iterate over all lines with d3-each.

Now for understanding, what do the Parameters of this function contain?

```
d3.select('svgEditor').selectAll('line').each(function(d,i){});

```

I know that `i` is the index but `d`, in this case, is always empty.

Shouldn't there be some Kind of iterated element or data inside?  

And is iterating the correct way or is it simpler and faster possible, perhaps with some function like a map?