Help syntax issue


#1


var text = "hagdgdgdkfgkgfgdgd\ fhdgfhdghjghjghgfhsgfshdgfhfghjgdhgs james \ john"

var myName = "james";

var hits=[];


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


#2

Hi his line

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

this part

; j<(i+myName.length ;

you didn't close the ) (put it before thr semicolon)


#3

Thank you , it worked


#4

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