PLEASE HELP! Guys. Can you please tell me what is wrong with the code. It gives me the whole name instead of the letters. it doesnt hit properly


It gives me the full name in the amount that equals to the variable text's length.

/*jshint multistr:true */
var text = "Hey, how are you? Your name is Reyan isn't it? Yes,\
my name is Reyan. How are you? I'm good. Blah Blah Blah Blah bla\
Have Fun Reyan.";
var myName = "Reyan";
var hits = [];
for ( var r = 0; r < text.length; r++){
    if (text[r]=== "R" ){
        for(var x= r ; x < myName.length+r ; x++ ){}
if(hits.length === 0){
    console.log( "Your name wasn't found");
    else {

Thanks guys!


that's why.

you just created a loop here and did nothing. Please revise that bit


Okay, I got it. Thank you so much!


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