added documentation how to get the index of an array element in a loop

* added single description line in the documentation
* added code example