What's the problem?


var text = "Text which contains Dani."
var myName = "Dani"
var hits = []
for (var i=0; i < text.length; i++){
if(text[i] === "D"){
for(var j = i; j <= i + myName.length; i++) {

It's not working. It looks like it crashes the browser, but I don't why would it be an infinite loop and what's the problem. Can someone help please?


Here you accidentally incremented i instead of j. :slightly_smiling:


Oh yes, thank you :smiley: