Please explain this code


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

can anyoneplease explain how this 2nd for loop works..


thanks to your if condition i will hold the index of the first letter of your name. So then you use the second for loop (j) to loop over i till i + myName.length, this way all letters of your name are found


thank you :slight_smile:


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