HALP PLS Search Text For Your Name 5/7


Can someone please help? I've been trying to figure this part out and I keep getting this message no matter how I change it:
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 = "blahhPotatoblahhhhhhhhhhhhhhhhhhhPotato";
var myName = "Potato";
var hits = [];
for (var a = 0; a <= text.length; a++); {
    if (text[a] === "P") {
        for (var b = a; b <= (a + myName.length); b++); {


In both loops, this should be < so it does not seek out of range.


I tried that, but it's giving me the exact same error.
Thank you.


There is a semi-colon in both loop statements that should not be there.



That was it!
Thank you very much. :>


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