CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Divisible by Three in a Loop

JavaScript code walkthrough · Question 18
easyLoops

Code

Read carefully. What does this print?
1for (let i = 1; i <= 6; i++) {
2 if (i % 3 === 0) {
3 console.log("fizz");
4 } else {
5 console.log(i);
6 }
7}

Your answer