6.log it error


/*jshint multistr:true */
var text = ("ddd", "aaai", "wwww", "ssss");
var myName = "Taaaa";
var hits = [];
for (var i = 0; i < text.length; i++)
        if (text[i]==="T")
                for( var j = i; j < (i+myName.length); j++)
                if (hits.length === 0){
                    console.log("Your name was'nt found");

I am getting different output can someone please help
Instead of getting name as my output. I am getting hits as output


A comma separated list of expressions will evaluate to the result of the last expression. Perhaps your text should be something else?

// see for yourself:

You seem to say that you expect your name to be printed, but none of your console.log's output anything that could be your name (You have two console.log's and they both print string literals)


Yeah I'm getting output as
Where as it should be printing out my letters right?
can you tell me where I'm doing wrong and also correct code for that.
Thank you


Look at your console.log's, is it possible for either of them to print your name?

If not, then you'll have to consider why and how your name would be getting printed and implement that, if that's what you want to happen.

If you think your name should be printed with the current code, then .. well you'd be wrong, but which console.log do you think would have that effect? Or what would be printing your name?

And again, check the value of your text

I'm just repeating myself here, I said the same things last message!


Got you
thank you :slight_smile: