Code Editor
Learn
Data Structures

(Re)Introduction to Iteration

Remember when we covered loops and iterators? We could use a whole bunch of different methods for looping in a program. When we loop over an array or a hash, we say that we iterate over it.

We'll be using the .each iterator to iterate over arrays and hashes in this section. Take a look at the code in the editor to see one example of how we might go about this.

Instructions

When you think you understand the code in the editor, click Run to see it in action.

Report a Bug
If you see a bug or any other issue with this page, please report it here.