Your second loop


#1

I'm not sure if it is my code but when I click save and submit, nothing is shown in the console. Please help.

var text = "Hey Adrien. Are you doing good Adrien?";
var myName = "Adrien";
var hits = [];
for(var i = 0; i < text.length; i++) {
if (text[i] === "A") {
for(var j = i; j < (myName.length + i); j++){
hits.push(text[j]);
}

}
}


#2

you will work on logging in the next exercise

this code is only to find your name in text and store it in an array


#3

oh so nothing is supposed to appear in the console?


#4

not yet, in the next exercise you will add this code


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.