5. Your second "for" loop


var text = "My name is Tyree and you will call me Tyree.";
var myName = "Tyree";
var hits = [];
for(var i = 0; i > text.length; i++)
if(text[i] === myName[0])
for(var j = i; j < (i + myName.length); j++)

I keep getting this error: 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.

Need help asap


Change your > sign to a < sign.


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