Programming-Idioms

History of Idiom 2 > diff from v25 to v26

Edit summary for version 26 :
[Ruby] Terser and more self-documenting

Version 25

2016-02-16, 15:14:01

Version 26

2016-02-16, 16:26:30

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Code
for i in 1..10 do
	puts "Hello"
end
Code
10.times do
	puts "Hello"
end