Want help in this. How to use for loop to exit?



Oops, try again. Careful: your second 'for' loop should stop when it reaches its current point in the string + myName.length.

/*jshint multistr:true */
var text= "Hey, i am Emily Emily Emily.";
var myName= "Emily";
var hits= [];
for(var i=0; i<text.length;i++){
    if(text[i] === 'E')
    {for(var j=0;j<myName.length;j++ ){


Maybe if you read
you will understand the Oops-message


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