5. Your Second "for" loop


#1

what is wrong with my syntax?

var text = "jfhbsdkjsfjsdjfhdgJimmygsdaydigshsfhsdfsdfJimmygh / sjkghsgskhjbhhdqywuyhfyzmzzjjzpclpzJimmydjsdhabdhabdhdbshdbsh / bqwyqupk";
var myName = "Jimmy";
var hits = [];
for(i = 0;i < text.length;i++) {
console.log(text[i]);
if(text[i] === "J") {
for (var j = i; j < i+ myName.length; j++){
hits.push(text[j]);
}
};


#2

Hi you forgot to close the first for loop }`` add one}` at the end.


#3

You also forgot declare variable 'i' in conditions in your first 'for' loop.