Stuck on second 'for' loop


I'm stuck at the second "for" loop portion of the "Search Text for Your Name" exercise. In addition to reading a bunch of other helpful answers on here, I've also tried troubleshooting this a half-dozen ways. I keep getting the "It looks like your second 'for' loop isn't pushing values to the hits array" error message.


/*jshint multistr:true */

var text = ["Years later, as he faced the firing squad, \
Shane would remember that distant Saturday when his father \
took him to discover ice."];

var myName = ("Shane");

var hits = [];

for (var i = 0; i < text.length; i++) {
    if (text[i] === myName[0]) {
        for (var j = i; j <= i + myName.length; j++) {



text is an array in your case, see what this does to your first loop:

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

your loop makes only one iteration, which makes sense given there is one item in your array


Ahhh. Got it. thanks!