I don't understand.What is wrong with this code?



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.

/*jshint multistr:true */

var text = "Hello my name is Jack. Nice to meet you?";

var myName = "Jack";

var hits = [];

for (var i = 0; i < text.length; i++);{
  if (text[i] === "J"){
      for (var j = i; j < (i + myName.length); j++){

I don't understand why this doesn't work please help!



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

the semi-colon after i++) will interrupt the loop. remove the semi-colon


Thanks man.Huge help.