Need Help On 'Your second "for" loop' Thanks


#1


"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 = "hello, Micky . An item from your order has shipped! You can now track it using the 'Track Package' button below. If you have any questions, contact us. Thank you, Micky .";
var myName = "Micky";
var hits = [];
    for(var i=0; i<text.length; i += 1);
        if (text[1] === "M")
    {
        for(var j = i; j < (i + myName.length); j++) 
			hits.push(text[j]);
	}

Please Help <3 Thanks


#2

it looks like you ended your first 'for statement' with a semicolon instead of using curly braces to include the code below that line.


#3

I tired removing the semicolon and using curly braces, but the same error message pops up. Thanks for trying to help though.


#4

Read my comments in your code and make the alterations :slight_smile:


#5

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