5. Your second "for" loop. I think I may be cheating my way through this lesson?



There are no error messages for this one. In fact it says I made it through this exercise alright, but nothing is printing to the console and I get the feeling that the actual JavaScript I'm writing is grammatically correct and all, but not QUITE what codecademy is asking for.

var text = "Persona 5 is coming out soon! James is so \
excited. James can't wait to play it and make his own James story."

var myName = "James"

var hits = []

for (var z = 0; z < text.length; z++) {
    if (text[z] === "J") {
        for (var a = z; a < z + myName.length; a++) {


If you need anything to print to the console, you would need to call it in



So then I am doing the lesson correctly then? LOL


Your code looks correct. Printing (or logging) the result will be done in the next exercise, but it doesn't hurt to check yourself in this exercise, you can add a console.log() to log something to the console, for example hits:




Code on! :smile: