2nd For Loop trouble (yes, I check the archive)


Okay maybe I'm just not seeing it. I get the classic "you're not pushing" error. What am I doing wrong?

/*jshint multistr:true */
var text = "Mitchell is the best, don't you love Mitchell";
var myName = "Mitchell";
var hits = [];

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

 if (text[i] === myName[0]) {

   for(var j = i; j < (myName.length + i); j++)  {



Just do:


You were on the right track, just remember it's J instead of I because you're in the second loop.


Thanks so much, after staring at it for a while I'm not sure how I missed that :smiley: :grin: