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


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

  1. Your second for loop
    <In what way does your code behave incorrectly? Include ALL error messages.>
    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);
}
}
}

<do not remove the three backticks above>

#2

Try pushing the letter at index j,

    hits.push(text[j]);

#3

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