Second "FOR" loop, I can't find the problem


#1


I get this error message:

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

myName's text is appearing in text variable so, why it doesn't works?

Thanks in advance


var text="Lorem ipsum dolor sit amet. Inma dictum felis eu pede mollis pretium. Inma elementum semper nisi. Inma tempus";
var myName="Inma";
var hits =[];
for (var i=0; i<text.length; i++);{
    if (text[i]===myName[0]){
    for (var j=i; j<(i+myName.length);j++);{
                   
                hits.push(text[j]);
                    }
            
            }
        
        }


#2

you have an unnecasery semi-colon after j++


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.