CJCoding With Joseph
← Back to Question List
JavaScript Code Walkthrough #29

Counting Ordered Pairs

mediumLoops

📄 Code

Read carefully — what does this print?
1let count = 0;
2for (let i = 0; i < 3; i++) {
3 for (let j = 0; j < 3; j++) {
4 if (j > i) count++;
5 }
6}
7console.log(count);

🎯 Your Answer