Your second "for" loop


#1

I've completely confused myself. I need some help.

/*jshint multistr:true */
var text = "i like the color blue \ and the color orange.";
var myName = " My name is Tracey and \ my middle name is Lynn.";
var hits = [];
for(var i = 0; i < text.length; i ++) {
if (text[i]==='E'); {
for ( j = i; j < ( i+myName.length) j++) {
hits.push(text[j]);
}
}
}


#3

Hello traceyroman,

I'm not sure if you are still needing an answer or not, but here is one!

In your var text, the idea is to have your name mentioned in it 3 times along with some text. The var myName is supposed to just be your name, which we are using as a reference to find in your var text.

In your first if statement, you want it to find the first letter of your name in your variable myName, which would be "T".

You are also missing a semicolon after (i+myName.length).

Hope this helps!


#4

Sorry, I didn't reply sooner. Yes, I did fix the problem. Thank you