I am stuck at 5/7, need help!


#1

I don't know what i did wrong, it always tells me "Oops, try again.
It looks like your second 'for' loop isn't pushing values to the
hits array. Make sure it's working properly and that myName's text
appears somewhere in the text variable."
Please help me

var text = "this is a text written by lilly";
var myName = "lilly";
var hits = [];
for (var i = 0; i < text.length; i ++); {
if (text[i] === "L"){
for (var j = i; j < (myName.length + i); j++) {
hits.push(text[j]);
}
}
}


#2

Well...

In these two statements, you put "lilly", right?

Then, you put:

Of course, you can't find any "lily" in the text because it doesn't have a capitalized L! In your text and your variable myName, capitalize the first letter of lilly so it would become Lilly.


#3

Also, there is an unnecessary semicolon after the closing parenthesis on your first and second "for" loops.