Logo

Programming-Idioms

History of Idiom 2 > diff from v113 to v114

Edit summary for version 114 by abood:
[JS] trying

Version 113

2020-05-18, 07:21:51

Version 114

2020-05-18, 10:14:42

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