Why won't this script .push my text?


#1

I cannot for the life of me figure out what is wrong with the second for loop and why the .push is not functioning. Please help!

var text = "Fourscore and seven alex ago"

var myName = "alex";
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(myName[j]);
}
}
}


#2

Look at this line of code

for(var i = 0; i < text.length; i++);{
                                    ^

remove that and you should be good to go!


#3

Wow, thanks a bunch. I can't believe it was that small