The second for loop


#1


whats wrong?


var text = "the Jeremy is little";
var myName = "Jeremy";
var hits = [];

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

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

    for (var b = i; b < myName.length;i++) {
        hits.push(text[b])   

    }

   }

};


I don't know whats wrong.


Replace this line with your code.


#2

Remember to include the i offset, and increment b, not i.


#3

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