No error message but nothing is printing to the console?


#1


var text = "Amanda is the best and she's going to Stanford";
var myName = "Amanda";
var hits = [];
for (i = 0; i < text.length; i++) {
    if (text [i] === myName[0]) {
        for (var j = i; j < i + myName.length; j++) {
        }
hits.push(text[j]);
}
}

    console.log (hits[0]);


#2

this line should be inside your second for loop,


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.