Unexpected Identifier


/*jshint multistr:true */
var text= "Garrett is a potato. And potato is a Garrett"
var myName = "Garrett"
var hits= [ ]
for(var i = 0; i< text.length; i++){
for( var j = i; j < i + length of myName)

I cant figure this out, I realize most of it is probably very wrong. If I add a "." before the "length then it gives me "unexpected token ."


You are missing the third parameter in the for loop. compare it to the first one. also you ae missing an opening brace

Now you wrote

you want the second for loop to go into the if block but you are putting it outside


but it still says unexpected identifier


you cannot write 'length of myName', make this correction in addition to the one you made earlier. and you need one more closing brace at the very end