Learn Ruby
Array
4.2
Lesson

each to handle each item of the array

An array holds a number of items. In this example the array is holding things I like.

Array has a special thing called each. Array also has do end block. In the do end block each item is captured in between those two vertical lines & printed one by one. Those two vertical lines are also called as pipes.