5. Your second "for" loop


#1


https://www.codecademy.com/courses/javascript-beginner-en-XEDZA/0/5?curriculum_id=506324b3a7dffd00020bf661#


I am not getting any errors, I was just curious if it was supposed to print out the way that it did. If it isn't I would like to know what in my code is causing this because I still passed with this result.


var text = "Blah Blah Blah Blah Blah Jonah Blah Blah Blah Jonah Blah Blah Blah Blah Blah Blah Blah Blah Jonah Blah Blah Blah Blah Blah Blah"
var myName = "Jonah"
var hits = [];
for (var i = 0; i < text.length; i++) {
    if (text[i] === "J") {
        for (var j = i; j < i + myName.length; j++){
            hits.push(text[j])
            console.log(hits)
        }
    }
}


#2

whoops never mind, it just printed out way too much because I put my name three times for no reason


#3