Hi, please can you help me? this code won’t run:
for (var i = 10; i >= 0; i–) {
console.log(10);
}
the error message says: “it looks like your loop didn’t log to 9 to the console”
Hi, please can you help me? this code won’t run:
for (var i = 10; i >= 0; i–) {
console.log(10);
}
the error message says: “it looks like your loop didn’t log to 9 to the console”
Well this prints 11 times the number 10. Which means that the error is correct and the number 9 is not printed. What you could do is to use i instead of 10 as i gets reduced with every loop meaning you count down from 10 to 0.