Exercise 5. Your second "for" loop - I'm stumped


I've looked at a bunch of the other posts on this lesson and I'm still completely stumped as to where I'm going wrong here... Any help would be greatly appreciated, I've been stuck for a couple hours.

/*jshint multistr:true */

text = "Hey, this is a string of text about Kit.\
Kit is learning how to code because Kit has some neat opportunities\
in her direct future if Kit keeps up her skillz.";

var myName = "Kit";
var hits = [];

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

Error: Oops, try again. There was a problem with your syntax.


Very simple just remove this after myName.length


In your second for loop


Ok, I took out the "+i)" but now it gives me this error message:

Oops, try again. Careful: your second 'for' loop should stop when it reaches its current point in the string + myName.length.


Oops, really sorry there didn't look at your code correctly,

Here's the format your for loop should have

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


Ah! That did it. I swear I had that at some point when troubleshooting my code... Who knows. Thanks so much for your help! What a relief.


No problem! You're welcome! :grin: