Search For Your Name 2nd Loop I Don't Understand?


#1

i dont understand what i did wrong or am missing?

var text="Hey i guess i am john"
var myName="john"
var hits=[]
for (var i=0;i if (text[i]===j) {
for (j=i;j }
}


#2

Hey @xfactor802,

Look at this. :smiley:


#3

var text="Hey i guess i am john"
var myName="john"
var hits=[]
for (var i=0;i if (text[i]===j) {
for (var j=i;j

}
hits.push[]

}

This was the full code, lol guess i didnt paste all


#4

var text="Hey i guess i am john"
var myName="john"
var hits=[]
for (var i=0;i if (text[i]===j) {
for (var j=i;j

}
hits.push[]

}


#5

Okay, @xfactor802, there's some things I don't understand about your code.:confused:

First, your for and if loop are fused together here:

Also, your second for loop isn't at all finished:

And your pushing nothing into hits.


#6

thanks for the reply,this isn't how my code looked at all! when i pasted and submitted it keeps shortening it for some reason


#7

Can you reedit it and show me your code again then?