The below fragment is one of the favourite kinds of examples in the Ruby world: 5.times { |i| print i, " " } It uses the times method*on Integer and prints: 0 1 2 3 4 There are many implementations of this in other languages, for instance*Ruby’s ‘times()’ function in C# | Of Code and Me*(which ...
More...