5/7 your second for loop


/*jshint multistr:true */
var text= "yehfbrweuihfreuwhfew Rachael sedufikjshflofd Rachael";
var myName= "Rachael";
var hits = [];
for(var i=0; i < myName.length; i++);
if (text[i] === 'R') {
    for (var R = i; R < (myName.length + i); R++);

Make sure you're pushing letters to the hits array


instead of myName.length try text.length


Oops, try again. Careful: your second 'for' loop should stop when it reaches its current point in the string + myName.length.


Ok, now looking back, all Rs need to be lower cased. the only capitol R should be in your text[i] === 'R' statement at the beginning of your if.


I changed the wrong .length, i realized it was for the first loop not second. It works now!


Ah! Well thats good! Sorry if I didn't clarify it enough! Happy coding


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