5. Please help


#1


I am stuck at part 5


It keeps on saying "Oops, try again. It looks like your second 'for' loop isn't pushing values to hit it's array. Make sure it's working properly and that myName's text appears somewhere in the text variable.


/*jshint multistr:true */
var text = "Hello my name is Emilia"
var myName = "Emilia";
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]);
        }
    }
}
console.log(hits);


#2

On this line, there is a stray semicolon. Do you see it?


#3

Yes thank you so much!


#4

Can someone explain the coding after the if statement and beyond? I don't understand why that coding is being chosen.


#5

If you read this link, it should clear things up:


#6

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