What is wrong with my code in 5/7?


#1

/*jshint multistr:true */

var text = "Hi my name is Jacob. I like my name, Jacob, because it sounds cool. Simply saying Jacob makes me happy.";

var myName = "Jacob";
var hits = [];

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

        hits.push(text[j]);

    }
}

}

The above text is what I have typed in for the code. I have been looking over the Q&A forum, but I can't find what's wrong with this. If someone could please inform me of what the issue is, it would be great. Thanks.


#2

@dogs12345,
You are using a semi-colon-; at the end of your 1st FOR-loop definition
like

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

The semi-colon-; is an End-of-Statement indicator for the Javascript Interpreter
so
remove the semi-colon-;