5. Your second "for" loop


I get a result of ...
['.',' ',undefined]
I've compared my code to some others that state theirs works. Other than the initial "string" and the name specifics, I can't see any thing.

var text = "I am named Mike. I have always been Mike and always will be Mike";
var myName = "Mike"
var hits = []
for (i = 0; i < text.length; i++){
if (text[i] === "M"){
for( j = i; j < (myName.length + i) ; j++); {




Don't forget to place your semicolons where they are needed.


It's amazing that the semi colon behind my second "for" loop was killing the whole thing. Sometimes this can be extremely frustrating.


most of the time a program doesn't work because of these small errors :smile: