2nd for loop?


#1

I can't figure out what is wrong with my code.


#2

Remember that commonly the computer reads what's put forth in front of it, it won't associate two things unless it knows it has to. With that being said let's take a look at the condition for your second for loop.

; j < i + myName.length ;

all the computer sees is " j < i ". and then it has no idea what's going on with "+ myName.length"

so lets associate those with some parenthesis!

; j < (i + myName.length) ;

I believe that'll fix the problem you're having!


#3

Hello, thanks for helping, but I did just that and it still wrong.Im not sure what the problem is. thank you!


#4

hits.push(text[N]);

I'm not sure where you got the "N" but replace that with "j"


#5

it worked! thank you so much. ive ben stuck on that problem and couldnt figure it out.haha