Separating the 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.>

```

//You have 500 good strawberries, indexed from 1 to 500
var goodStrawberries = 500;

//For every strawberry whose index is divisible
//by 5, decrement the value of goodStrawberries by 1
for(var i = 0; i < goodStrawberries; i++){
if(i % 4 === 0) {
goodStrawberries–;
}
}

console.log(goodStrawberries);
Replace this line with your code.

<do not remove the three backticks above>

#2

the instructions:

//For every strawberry whose index is divisible
//by 5, decrement the value of goodStrawberries by 1

you checked if the index is divisible by 4, the instructions say: index is divisible by 5


#3

Never mind I just saw I did not decrement goodStrawberries properly.

that was the only thing wrong with my code.


#4