What did I do wrong, 5/7


#1

var text = "Hello, my name is Raghu. It is Raghu. Yeah, Raghu"
myName = "Raghu"
hits = []
for (var i=0; i < text.length; i++);
if (text[i] === [myname]) {
for (var R=i; j < (myName.length + R) R++) {
hits.push(text[i]);
}
}


#2

You need to declare myName and hits too like you did with text like var myName


#3

Hi first here you should remove the ; after the for loop

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

1 if statement

if (text[i] === [myname])

You should put text[i] equal to the first letter of your name like that

if (text[i] === "R")

2 second for loop

for (var R=i; j < (myName.length + R) R++)

Make your ming or you use R or j so Its should be liKe that .

And inside (myName.length + R) you should do + i like that.

for (var j=i; j < (myName.length + i) j++)
Or

for (var R=i;  R< (myName.length + i) R++)