Last active
January 16, 2020 15:46
-
-
Save adedayojs/2650892cfdbb29de83c7379b9c8133a4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// This function allows you to loop through a certain number of times | |
// It is similar to the range function in python (if you are familiar with python) | |
function loopNumbers(number){ | |
for(let i of [].constructor(number)){ | |
// Do your thing | |
} | |
// Other function related things | |
} | |
// You could Just extract the for loop like this | |
// Mind You Replace number with the number you intend | |
for(let i of [].constructor(number)){ | |
// Do your thing | |
} | |
/*** EXAMPLE ****/ | |
for(let i of [].constructor(7)){ | |
// Do your thing | |
console.log('Called') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment