Your Second "for" Loop >>>>ASSIST


Pleas my code keep going into an endless loop. How can I fix it?

/*jshint multistr:true */

var text = "Anjola Obadiah Joseph Yakubu Nikalus Alexander Joannes"

var myName = "Anjola"

var hits = []

for (var i = 0; i < text.length; i++){
if (text[i] === "A"){
for ( var j = 1; i < myName.length; j+myName.length){


you need to push your text variable and all the items your variables is looping through text[j]



It still goes into an endless loop and crashes my browser.


Oops yea that's dangerous :cold_sweat: Please post your updated code so I can take a look at it again:slight_smile:


Thanks I finally figured it out.


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