Created
October 7, 2016 11:10
-
-
Save thelbouffi/bbb1d2a2674ae87b94aefb9e83a7646f to your computer and use it in GitHub Desktop.
Loop using self invoking function and decrementation
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 code will generate 10 iterations | |
(function test(i){ | |
console.log('test'+i); | |
// put here the code of anything you want to execute | |
if(i--){ | |
test(i) | |
} | |
})(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment