Why doesn't this run correctly?


#1



https://www.codecademy.com/courses/javascript-beginner-en-XEDZA/0/5?curriculum_id=506324b3a7dffd00020bf661#


There is a Syntax Error that comes up that says I have and extra left parenthesis.


/*jshint multistr:true */
var text = "John Jack Jonathan Joseph Jack James"
var myName = "Jack"
var hits = []
for (i = 0; i < text.length; i++){
    if(text[i] === "J") {
        for(var j = i; j < i + myName.length) {
            //for body
        }
    }
}


#2

Hi this line

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

it's missing something do you see what?
and inside the second for loop you should .push() text[j] in hits