Stuck on 'Your Second "for" Loop


#1

/*jshint multistr:true */
var text = "Hey, how are you \
doing? My name is Zee jay.";

var myName = "Zee Jay";

var hits = []

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

What's wrong with my code? It doesn't seem to be working.


#2

@javaace73552,
Your first FOR-loop should go over the text

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

#3

My code works now, thanks!