2nd 'for' loop



I'm trying to understand why it isn't pushing any text to the hits array. I have looked at other topics bt I'm still not understanding. I'm very new at this, and possibly not understanding the entire concept. Thanks for the help.

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.

Replace this line with your code. 

/*jshint multistr:true */
var text = "Hey guys I'm Drew, I'm a homosapien, more or less. Drew has evolved over many thousands of years to become the computer using weirdo Drew he has become today!";
var myName = "Drew";
var hits = [];

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


Remove the semi-colon from both of the above lines.


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