What's wrong with my code? i read all the related topic but still don't get the right code to pass through


#1

var text= ["Tamas asdasd Tamas asdasd, asdasdasdasdasda Tamas"]
var myName = ("Tamas");
var hits = [];

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


#2

Go back to lesson 1 and study the example. That should give you an idea of what is wrong above.


#3

for some reason, in your case text contains an array, this should be a string

Not sure why you use parentheses in this line:

var myName = ("Tamas");

#4

Thank you, now i see it...sorry for the stupid question


#5