5. Your second "for" loop



I have been looking at other posts and can't find where my code it going wrong. It is probably a little mistake and I am just not catching it so can someone please help me out? This is the error message:

Oops, try again. It looks like your second 'for' loop isn't pushing values to the hits array. Make sure it's working properly and that myName's text appears somewhere in the text variable.

This is my current code:

/*jshint multistr:true */
var text = "blah blah blah hahaha \
hahaha jess hahaha blah blah what the heck \
am I doing hahahaha jess blah blah blah"

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

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


Also if anyone could let me know how I would actually use the arrays and the loops in future coding that would be a great added bonus haha. Again thank you to whoever helps me!


We never write a semi-colon before a block {}.


I feel so stupid haha, thank you so much


Be easy on yourself. It's not stupid to make a mistake, only to not care about it.


For readability, consider writing i ++ as i++, and j ++ as j++.