The second 'for' loop -Search Text for your Name


var text ="Whitney sdfsdf Whitney dfs Whitney dsfsd Whitney sdfsdf Whitney Whitney Whitney Whitney run run run run run run"

var myName ="Whitney Whitney Whitney Whitney Whitney Whitney Whitney"

var hits=[]

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

I am at my end...Someone help please. I don't understand why it isn't working. Also please explain how exactly does this work?



Should be:



It's still showing me this

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.


You didn't change it. This should be:

for (var i = 0; i < text.length; i++)