What did i did wrong



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

var text = "I my neme is Carl,\
            yes Carl is realy my\
var myName = "my name is Carl";
var hits = [];
for(i = 0;i < text.length+1;i++){
    if(text[i] === 'c'){
        for(i=0;i < Carl.length;i++){
            console.log( myName);



var myName = "my name is Carl";

just put your name as you will be searching your name not the whole sentence.

var myName = "Carl";

for(i=0;i < Carl.length;i++)

In this line of code...the initialization of loop will be there where it sees text[i] === 'c'
so it will be initialized not from 0 buti?
also fix the second part of for loop. i < Carl.length ,use your Error notification to fix this.

read the theory and instructions again.
After you fix those two,you will have one more thing to do. If you read theory you will know.


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