Add documentation example of using 'register' with a loop

This documentation change adds a new section that describes the differences of using `register` in a loop.