I can't find my bug!


#1

var text = "Hey, how are you\
doing? My name is Juliana.";
var myName = "Juliana";
var hits = [];

for (var i =0; i if (text[i]===myName[0]){
for (var j=i; j hits.push(text[j]);
}
}
}
if (hit.length === 0){
console.log("Your name wasn't founded");
} else console.log(hits);

The result shows "ReferenceError: hit is not defined",
I don't understand why.


#2

Hi its missing in your code the if statement. bewtween your for loops .