Search text for your name. Part 5


#1

I'm supposed to be adding a second for loop, this one inside the if statement, I cannot figure out what I'm doing wrong. can anyone help? thanks in advance

/*jshint multistr:true */
var text = "Brock Brock Brock"
var myName = "Brock"
var hits = []
for (var i = 0; i === text.length; i++)
{
if (text[i] === myName[0])
{
for (var i = 1; i > myName.length; i++)
}
}


#2

update:
the for loop should be

for (var i = 1; i === myName.length; i++)

but it still is not right


#3

in the for loop its an assignment. So it should be: for (var i = 1; i >= myName.length; i++). If you dont understand this part to well, i advice you to go back and refresh your mind. Other than that Hope this helped and

Have a late Merry Christmass :evergreen_tree: :- )


#4

i've done that now, still no good.


#6

another update, figured that out (maybe) now heres what I need:

"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."