Logo

Programming-Idioms

History of Idiom 2 > diff from v40 to v41

Edit summary for version 41 by :
Restored version 39

Version 40

2016-02-18, 16:57:55

Version 41

2016-02-18, 17:17:46

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
print "Hello\n" for 1 .. 10;
Code
print "Hello\n" for 1 .. 10;
Comments bubble
Note the necessary newline (\n), not to print every time on the same line
Comments bubble
Note the necessary newline (\n), not to print every time on the same line
Code
10.times do
	puts "Hello"
end
Code
10.times do
	puts "Hello"
end
Code
for(i=0;i<10;i++)
	console.log("Hello");
Code
for(var i=0;i<10;i++)
	console.log("Hello");