Your second 'for' loop isn't pushing values to the hits array


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.

this is the error that it says..
plz help i am unable to figure it out..

var text="how are you ash. i am ash. what you doing ash?";
var myName="ash";
var hits=[];
for(var i=0;i{
for(var j=i;j< (myName.length+ i); j++)

please help

Help with Your second "for" loop!

That happened to me too and i cant figure it out


Where is the end to your loop?

for (var i = 0; i < text.length; i++)

The second loops wont work because all you've declared in the first is that i = 0

There might be something else, but this is what I've noticed so far.


I got some help and this was my final code
/*jshint multistr:true */
var text = "Hey, how are you \
doing? My name is Renee .";
var myName = "Renee";
var hits = [];

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


This worked. Thank you!