Learn Ruby
Range
8.1
Lesson

each to print value of each item

Let’s say that I want a range of numbers from 1 to 20. In Ruby we can get range of numbers by using (1..20).

Just like an array, a range also supports each and do end which we can use to print each value.