Programming-Idioms

History of Idiom 2 > diff from v36 to v37

Edit summary for version 37 :
[JS] Not using var will initialize i in the global scope.

Version 36

2016-02-17, 11:00:41

Version 37

2016-02-18, 08:11:17

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=0;i<10;i++)
	console.log("Hello");
Code
for(var i=0;i<10;i++)
	console.log("Hello");