Calls the given function for each element (and optional index) of the given list or iterator.
A function that will be called with each element and (optional) iteration index.