6/7 - What is the difference between my answer and the correct answer?


#1

The top is my answer, and below that is the correct answer that I got by clicked “get code”. The only thing I notice is that the correct answer has a red “i” and mine has a blue “i”. However, I can’t seem to make my “i” red. What is the problem here, and how does this prevent my code from running?what's happening

Thanks.


#2

The color does indicate an irregularity in expected syntax. In this case it is the commas in the for parameters.

Aside

Scrunching up code makes it harder to find errors, which can be hard enough to find as it is. Take liberty with whitespace and separate everything (in script, not HTML, another topic). Notice how the given solution separates values and operators by a space on each side? The exception is the semi-colon which by converntion never has leading whitespace.


#3

I see, thank you very much!


#5

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