Step 4, your if Statement


#1


Somebody please help. I cant be able to continue, thanks.

https://www.codecademy.com/courses/javascript-beginner-en-XEDZA/0/4?curriculum_id=506324b3a7dffd00020bf661


Replace this line with your code. 

for(var i = 0; i < text.length; i++ if(first letter === 'J'){
    continue coding;
    } {
}


#2

if you have a for loop:

for (loop initializing){

}

and you want to nest an if statement inside, this shouldn't be in the loop initializing (var i = 0; i < text.length; i++) but rather inside the for loop :

for (loop initializing){
   if (condition){ // do someting }
}

#3

Like this? where have I gone wrong, its still not working.

for(var i = 0; i < text.length; i++)
{ if(text[i] === 'J'){
continue coding}
{
}


#4

yep, almost but here:

continue coding}
{ // this one
}

i don't know why you have a { in there, i would remove it, it doesn't seem to serve any purpose


#5

Thank you, but not yet quite there. Like this?

for(var i = 0; i < text.length; i++) {if(first letter === 'J')
continue coding}


#6

Sorry, I mean this , which is also not working.

for(var i = 0; i < text.length; i++)
{ if(text[i] === 'J'){
continue coding}


#7

the { of the for loop now doesn't have a matching closing curly bracket (}) and you should remove continue coding or turn it into a comment, there can only be code there.


#8

Great! Thanks much Stetim for your support. Apologies for any inconveniences caused. Good day.


#9

It worked. I appreciate.


#10

#11

no problem, that is what the forum is for right? If i didn't want to help people, i wouldn't be here on the forum :stuck_out_tongue: