LoginSignup
1
0

More than 3 years have passed since last update.

最短コードで100ループしてみる

Last updated at Posted at 2019-11-14

最短のコードで100ループさせる方法を考える遊び。

for(let _ in [...Array(100)])console.log(_)
[...Array(100)].forEach(_=>console.log(_))
(i=>{do{console.log(i)}while(i--)})(99)
for(let _ of Array(100))console.log(_)
(i=>{while(i--)console.log(i)})(100)
let i=100;while(i--)console.log(i)
for(let i=100;i--;)console.log(i)
// ちょっと反則感
[...Array(100)].map(console.log)

@shiracamus さんコメントありがとうございました!

1
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0