6 Log It! My code works but output isn't correct


#1

Hi, I'm stuck on "Log It!" My code passed, but it is returning an output of: [ ' ', ' ', ' ', ' ', ' ' ]

Here is my code:

/*jshint multistr:true */
var text = "You learn to Lauren take your coffee black\
you Lauren learn to drink Lauren your whiskey neat.\
Lauren drinks coffee. Lauren hates whiskey.";
var myName = "Lauren";
var hits = [];
for (var i = 0; i < text.length; i++) {
if(text[i] === "L") {
for (var j = i; j < (myName.length + i); j++); {
hits.push(text[j]);
}
}
}
if(hits.length === 0) {
console.log("Your name wasn't found!");
}
else { console.log(hits);
}

Any ideas of what I have wrong?

Thanks!


#2

Remove the semi-colon so letters are pushed to the hits array.


#3

It worked! Thank you so much mtf!