Can anyone can help me with this?


#1

Can anyone can help me with this?

/*jshint multistr:true */

var text= "dasEmily";
var myName = "Emily";
var hits = [];
for (a = 0; a > text.length; a++) {
if(text[a] == "E") {
for( var b = a; b < (myName.length + b); b++) {
hits.push(text[a]);
}
}
}


Second For Loop Not Pushing To Hits Array
#2

Hi here

for (a = 0; a > text.length; a++)

You should change a > text.length to a < text.length

And then here

hits.push(text[a]);

You should put inside text[here] b like that

hits.push(text[b]);