The second loop problem. I'm very muddled and no one seems to share my problem


var text = "Hey, I was wondering if we had art class today, Artreyu: do we? Because i've brought my Artreyu stuff for the class. Artreyu. Art, blahahahaha blahahaha, Artreyu.";
var myName = "Artreyu";
var hits = [];

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

if(hits.length === 0 ) {
    console.log("Your name wasn't found")
else {
console.log( hits );

I get Your name wasn't found.


On line eleven, your curly brace } doesn't need a semicolon. You console.log("Your name wasn't found") should have a semicolon at the end of it. Hope this helped you.


Your correct about the semicolons still I get 5 outputs when I run the code 4 for "Atreyu" and 1 for "Art". Maybe try to refresh the page and give it another try as it should really work. Maybe stuff got stuck in the memory from a former try and would be resolved by refreshing the page.


If you erase the last sentence in your text it works. I think it doesn't like something with the names in the last sentence.