For and Each Loops
Let's learn the for and each loops.
When to use
As with most loops, using them is largely a personal preference.
To create a for loop:
for number in 0..10
To create an each loop:
(0..10).each do |number|
Hints & tips
- Use for loops to loop within a range
- Use each loops to loop over each item
Lesson notes are only available for subscribers.