Questions on second "for" loop


/*jshint multistr:true */
var text = "blak blah Jerry Jeremiah blah blad Jeremiah blah";
var myName = "Jeremiah";
var hits = [];
for (var i= 0; i < text.length; i++){
    if(text[i] === "J"){
    for (var j = i; j < text.length + i; i++){

My browser tab freezes whenever i try and enter this. I don't know if it is wrong or not.


for (var j = i; j < text.length + i; i++)

Here you increment i instead of j, so j will always have the same value while i keeps getting larger. Since j will always be less than text.length + i, the loop is infinite.