'Your second 'for' loop help!


Please help! I can't figure out for the life of me what I am doing wrong!

var text = ("Jayne", "Eevee", "Jayne", "Fiona");
var myName = ("Jayne");
var hits = [];

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


your second for loop:

for(var J = i; J < (myName.length + i); i++)

why use i++? the second for loop from beginning till end of your name, to achieve this J should be increased


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