Enum

with_index/2

with_index(enumerable, offset \\ 0)

Returns the enumerable with each element wrapped in a tuple alongside its index.

If an offset is given, we will index from the given offset instead of from zero.