Unexpected token? Search text for name


#1


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


Hi there! So I've been getting the "unexpected token" thing in the console and I can't seem to find what token is unexpected in my code. Help would be very appreciated. P.S I'm a noob at JavaScript :smiley:


Replace this line with your code. 
/*jshint multistr:true */

var text = " Hi! Srinjoy's name is Srinjoy! Srinjoy \
likes to talk in third person!"

var myName = "Srinjoy"

var hits = [] 

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


#2

[stdin]:13
        for (var j = i; j < text +text.length;  j++;)
                                                   ^

SyntaxError: Unexpected token ;

nodejs's error message for your code


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.