5. Your second for loop error, idk what's wrong help plz


#1



https://www.codecademy.com/courses/javascript-beginner-en-XEDZA/0/5?curriculum_id=506324b3a7dffd00020bf661


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 ="test, lul lul lul lul frans lul lul lul frans and lul frans lul.";
var myName="frans";
var hits=[];
for(var test = 0;test < text.length; test++){
    if(text[test] === "f"){
        for(var j=test;j<(myName.length+1);j++){
                hits.push(text[j]);
            }
    }
};


#2

it should be myName.length+test


#3

oh my god thanks. . thought gonna stuck here forever lol