Search Text for Your Name #5 Your second "for" loop (PLEASE HELP)


#1


I am stuck and not sure what is wrong. Please Help


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


SyntaxError: Unexpected token


/*jshint multistr:true */
var text = "My name is Jon, I ski vail. People call me Jon \
 I opened a restaurant names Jon Restaurant." ;

var myName = "Jon";

var hits = [ ]

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


#2

this bit off code in your second for loop:

(i+ (myName.length + i)

problems: not matching number of brackets. i+ myName.length + i? why? why i twice?


#3

This post was flagged by the community and is temporarily hidden.


#4

thank you! those small details will get you