Last active
April 8, 2019 04:42
-
-
Save pocotan001/d805ad631af91a8137d217f92d1a4d44 to your computer and use it in GitHub Desktop.
Loop for N times
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const n = 10 | |
Array.apply(null, Array(n)).forEach( … ) | |
// or | |
[...Array(n).keys()].forEach( … ) | |
// or | |
Array(n).fill().forEach( … ) | |
// or | |
Array.from({ length: n }).forEach( … ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment