Skip to content

Instantly share code, notes, and snippets.

@wakamsha
Last active April 25, 2019 13:00
Show Gist options
  • Save wakamsha/5df087c35ee8e0882e99ea25a29695a0 to your computer and use it in GitHub Desktop.
Save wakamsha/5df087c35ee8e0882e99ea25a29695a0 to your computer and use it in GitHub Desktop.
for 文を使わずに規定回数だけ処理を繰り返す
// [...Array(n)] という書き方が使える
[...Array(100)].forEach((_, i) => {
// 何らかの処理
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment