Second for loop


second for loop

The error
Oops, try again. It looks like your second 'for' loop isn't pushing values to the hits array. Make sure it's working properly and that myName's text appears somewhere in the text variable.

/*jshint multistr:true */
var text = "hey how are you doing Nathan is doing good"
var myName = "Nathan";
var hits =[];

for (var i = 0 ; text.length < "text" ; i++){
    if (text[i] === "N"){
        for(var j = i; j < i+myName.length ; j++){


add console.log to print


but your for loop is not right



why this condition in your first for loop:

text.length < "text"

i would do:

i < text.length;

this will make i loop over the text in your text variable