What is wrong?


PLZZZ HALP stuck at for the past 3 hrs. Finally sucked up my pride :frowning:

The error msg: 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="Blah Blah Marcus";
var myName="Marcus";
var hits=[];
for(var i=0; i<text.length; i++ );
    if (text[i]==="M")
        for(j=i; j < (myName.length + i); j++)


Hi this line remove the ; at the end

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

You can read more about it here

then here


you should push inside hits text[j] and not myName[j]


i know maybe the answer is obvious or what, but i dont get it, what does it mean to push into text[j]?


and btw thx :smiley:


you can fnd an accurate axplaination here


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.