Logo

Programming-Idioms

History of Idiom 2 > diff from v114 to v115

Edit summary for version 115 by :
Restored version 113

Version 114

2020-05-18, 10:14:42

Version 115

2020-05-18, 15:19:58

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Illustration

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Illustration
Code
for (let i = 0; i < 10; i++) {
  console.log("10");
}
Code
for (let i = 0; i < 10; i++) {
  console.log("Hello");
}
Comments bubble
let quarantines the scope of i to the loop in ES6
Comments bubble
let quarantines the scope of i to the loop in ES6