Programming-Idioms

History of Idiom 2 > diff from v111 to v112

Edit summary for version 112 :
[JS] shorter

Version 111

2020-04-29, 09:03:11

Version 112

2020-04-29, 09:04: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
[...Array(10).keys()].map(()=>console.log('Hello'))
Code
[...Array(10)].map(()=>console.log('Hello'))