Stuck on 5/7. keep looking through syntax but it looks right


#1
/*jshint multistr:true */

var text = " blah blah blah blah blah Jeff Jeff Jeff Eric Eric Eric blah blah blah"; 

    var myName = "Jeff";

    var hits = [];

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

Oops, try again. It looks like your second 'for' loop isn't pushing values to the hits array. Make sure it's working properly and that myName's text appears somewhere in the text variable.


#2

@microjumper43766,

You are using a semi-colon-;
at the end of your 1st FOR-loop definition...

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

The semi-colon-; is an End-of-Statement indicator
to the Javascript Interpreter.

Remove this semi-colon-;


#3

Thank you! This solved my issue.