I'm new to JS but this works for me
Code:for (var x = 20; x >= 8; x -=3){ if (x < 10){ console.log("The end"); } else { console.log(x); } }
Actually, I've decided this while loop will be better
Code:var x = 20; while (x >= 10){ document.write(x + "<br>"); x = x - 3; } document.write("The end");
Become Part of This Conversation
Join NowFor Free!