Unexpected token? Search text for name



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++;)


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

SyntaxError: Unexpected token ;

nodejs's error message for your code


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