Stuck in 13 conclusion Introduction to 'For' Loops in JS


SyntaxError: Unexpected identifier

var text = [jjjj kkkk llll jim tom jeff yyyy ttt rrr eeee jim tom ];

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

Replace this line with your code.


replace the semicolon after the for loop with a {.


You are incrementing i in your second for loop. You should be incrementing j there:

for(var j = i; j < myName.length; j++){
// code for loop here

Also, haxor789 is correct that you need an opening brace, not a semicolon, after the for loop. And don't forget your closing brace too!