Created
June 9, 2014 19:20
-
-
Save PlenipotentSS/54071ff6310708102a02 to your computer and use it in GitHub Desktop.
NESTED LOOP
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
// NESTED FOR LOOP: | |
for(var i=0;i<3;i++) { //declare i=0; stop if i >=3; increase i by 1 after each run | |
for (var j=0;j<2;j++) { //declare j=0; stop if j>=2; increase j by 1 after each run | |
console.log(i+" "+j) //prints i and j for each iteration | |
} | |
} | |
//this should returns: | |
// | |
// 0 0 | |
// 0 1 | |
// 1 0 | |
// 1 1 | |
// 2 0 | |
// 2 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment