Your second "for" loop


#1



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

Can someone elaborate how the for loop for var j executes please? I am confused here. Many thanks

/*jshint multistr:true */
var text = "My name is Adi, and I would like to meet di, because is di\
is cool guy."
var myName = "Adi";
var hits = [];

for(i=0; i<=text.length; i++){
if(text[i]==="A"){    
// If we find it, add characters up to
// the length of my name to the array
	for(var j = i; j < (myName.length + i); j++) {
		hits.push(text[j]);
		}
	}
}

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


#2

@ajaxjumper08329,
Please read
https://discuss.codecademy.com/t/your-second-for-loop-stuck/30525/4?u=leonhard.wettengmx.n