Second for loop not pushing values to array


I'm getting the following error:

"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"

Been stuck here for a while...what am I doing wrong?

var text = "Hi, my name is Daniel. I happen to think that is a great name"

var myName = "Daniel"

var hits = []

for (i = 0; i < text.length; i++); {
    if (text[i] === myName[0]) {
        for (j = i; j < i + myName.length; j++) {



after i++) you have a unnecessary semi-colon


you need to declare-> var j; put the semicolon after each var;
delete the ; for the first for loop, I think that's the issue


why do we need to do this? Is it better practice? Yes. Mandatory? No


This was the issue, thanks.

cloudace, the code passed without declaring var but I had not noticed that so thanks for pointing it out.