method

with_index

with_index()
public

Iterates the given block for each elements with an index, which start from 0. If no block is given, returns an enumerator.