5/7 Saying It looks like your second 'for' loop isn't pushing values to the hits array


#1

Ughhhhhhhhhhh... Trying to get to 50% before bed until this little turd came straight outa left field. What exactly am I doing wrong? plz help :smile:

/*jshint multistr:true */
var text = "Hey, Justin Icecream Justin.";
var myName = "Justin";
var hits = []
for(var i = 0; i < text.length; i++);{
if (text[i] === 'J'){
for(var j = i; j < myName.length + i; i++){
hits.push(text[j]);
}
}
}


#2

In your second-FOR-loop you will want to increment j and NOT i
for(var j = i; j < myName.length + i; j++){


#3

Made changes... It still doesn't work.........


#4

You also will have to change
for(var i = 0; i < text.length; i++);{
into
for(var i = 0; i < text.length; i++) {
as the semi-colon is an End-of-Statement indicator !!!


#5

Got it! thank youuuuuu very much


#6

Thanks and sorry for what i said about your sites
:disappointed_relieved: i feel ashamed