3/7 Unexpected Toke


#1

Hey, I'm having an issue getting my code to work. I've looked over this quite a few times but I cant figure whats wrong! This is what I have.

var text = "I can code reeeeeeally good";
var myName = "My name goes here";
var hits = [];

for (i=0; i <= text.length; i++:wink: {

}

Any help would be appreciated :smile:


#2

Hi because of not existing codeformat its hard to read.

But i think you have here an mistake

for (i=0; i <= text.length; i++;)

After i++ is no ; needed


#3

You are right! Thank you very much :smile:

Can I ask quickly, why do I need a ; at the end of the other 2 parts but not there?


#4

I suppose that these semicolons are only for separated values. And after i++ doesnt come any value
I found for you an Topic in the old Forum.
It shows you where you should use semicolons .

https://www.codecademy.com/forum_questions/507f6dd09266b70200000d7e#answer-508000efde2d860200004bbe

Sorry for my bad english :wink:


#5

No thats great, thanks for all your help