Separating rotten strawberries


#1

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>

```

Replace this line with your code.
let goodStrawberries = 500;
for (let i = 1; i <= 500 ; i++) {
if (i % 5 === 0 ) {
goodStrawberries = goodStrawberries-1 ;
}
}

console.log (goodStrawberries);

error: Oops, try again. Your value for goodStrawberries is incorrect. Check your arithmetic and your loop bounds.
<do not remove the three backticks above>

#2

i can’t find the exercise, can you share the exercise url?


#3

https://www.codecademy.com/courses/introduction-to-javascript/0/3


#4

you could try using i=0:

for (let i = 0; i < 500 ; i++) 

but both should work, maybe refresh the page? the problem is that the learning environment of those exercises is no longer supported, so bugs might be common, upgrade to the new JS course


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.