Tell us what’s happening:
I’m getting the error "You should be using a for loop for this. I thought my code is right…
Your code so far
for (var i = 9; i > 0; i -= 2) {
myArray.push(i);
}
// Setup
var myArray = [];
// Only change code below this line
for (var i = 9; i > 0; i -= 2) {
myArray.push(i);
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
.
Challenge: Count Backwards With a For Loop
Link to the challenge: