What is wrong with my code? it crashes my brawser when I run it


#1


var text = "apple orange apple orange Angelika Elephant Rainbowwwww Anaconda Angelika aplle";
var myName = "Angelika";
var hits = [];
for (var i=0; i < text.length; i++)
{
    if (text[i] === "A")
        { 
        for (var j = i; j = (myName.length+i); j++)  {
    hits.push(text[j]);}
        }
}


#2

the condition of your second for loop:

j = (myName.length+i);

you want this condition to be true while j is lesser then (<) then myName.length, since you use j to loop over your name


#3

OMG! I missed this mistake. Thx so so much :slight_smile:


#4