Second 'for' loop isn't pushing values to the hits array


#1


  1. Your second for loop

    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 = ["lelelelelelele elelele LJ lelel lelele lele \ leleleleelele LJ lelele LJ lelelelelelele"];

var myName = "LJ";
var hits = []
for (i=0; i<text.length; i++)   {
    if (text[i]==="L")  {
        for(j=i; j<i+myName.length;j++) {
            hits.push(j);
        }
    }
}


#2

Try pushing the letter at index j,

    hits.push(text[j]);

#3

your text variable is a array, it should be a string