Your second "for" loop. SyntaxError: Unexpected identifier. Please help


#1

/*jshint multistr:true */
var text = "Hey, How are you doing? My name is Ellen";
var myName = "Ellen";
var hits = [];
for(var i = 0; i < text.length; i++) {
if (text[i] === "E") { for(var j = i; j <(i + myName.length) j++) {
hits.push(text[j]);
}
}
}


#2

@webninja69180,

You are missing 1 semi-colon-; in your 2nd FOR-loop.

Change your

 (var j = i; j <(i + myName.length) j++)

into

(var j = i; j <(i + myName.length); j++)

the for-loop:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for


#3

Hi here

 for(var j = i; j <(i + myName.length) j++)

You forgot to put a ; after (i + myName.length)

Like that

for(var j = i; j <(i + myName.length); j++)