Can't figure out whats wrong with loop


var text = "Ian is Ian which is Ian who is \ Ian he is Ian I am Ian.";
var myName = "Ian";
var hits = [];

for ( i=0; i {if (text[i] === "I") {for(var x = i; x {hits.push(x);
} }}

Sorry, really having trouble on this one. Any help would be appreciated. :slight_smile:


Maybe if you read an analogy


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