Second Loop Not Pushing


#1

Looking to find out what about my second for loop isn't pushing values to the hits array.
All help is appreciated greatly, Thanks

var text = "Solstice The Flow Mallory Abby Ali Jacob Jared Dufrane Biesel Adair Jake Ben Westin Noah Jake Jack Stewie Zach Nicole Lexi Maddie Sean Karie Josh Patty Jake Cole Connor Savannah"
var myName = "Jake"
var hits = []

for ( i = 0; i < text.length; i++) {
if (text[i] === 'J') {
console.log("Hey");
for (var j = i; j < (myName.length + 1); j++ ) {
console.log("Hello");
hits.push(text[j]);
}
}
}


#2

@liqhtweight,

Syntax

for ([initialization]; [condition]; [final-expression]) {
    statement
}

You will have to change the condition in your 2nd FOR-loop
into

 j < (myName.length + i)