The Evolution Of Ruby Iteration

Becoming proficient with Ruby requires that you have a good understanding of many aspects of the language, however I would consider iteration the foundation for most of this functionality. Below are several routines which all output the same result, poor ruby programmers may find themselves with many routines that look similar to those at the top of the list, however knowledgeable ones will find themselves near the bottom.

Which all output:

["foo", "bar", "foo"]

Comments

the last one was sweet.