Exercise 9 · Chapter: For LoopsOptional+50 XP
Fix the Step
This program should count backwards from 5 to 1, but it freezes and runs forever. Fix it!
Expected output:
5 4 3 2 1
Hint: When counting backwards, the counter should go down.
Need a hint?
3 available · costs 5 XP each
javascript
for (let i = 5; i > 0; i++) {
console.log(i);
}
Output
Run your code to see the output here.