Could somebody help me a bit? Your second ''for'' loop


#1

Here is my code so far

/*jshint multistr:true */
var text = "Hey how are you \
doing? My name is Emily.";
var myName = "Toma";
var hits = [];

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

}

#2

Its says

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.


#3

I don't know if it solves the issue, but you didn't write your name "Toma" anywhere in the text var so it doesn't have anything to push. I hope this helps.


#4

Hi this part you should remove the ; after the for loop

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

#5

Well I fixed it but thanks for help both of you