Trying to avoid pushing similar names into hits array


#1

Hi guys, my code is here: JsFiddle

Am I doing something wrong? It's always going to that even if the first is Alex and not Adam


#2

@webwhiz18739 i updated your fiddle check if you can see it HERE


#3

Wasthat what you were looking for? Did you understand it?


#4

Hi I'm not at home right now but I'll take a look in a few hours thanks. Have a happy new year


#5

Hi Sorry for the late reply.

I want him to say Adam is not my name if Adam appears instead of Alex.


#6

all you have to do is add print statements to this part of your code

        if(found === myName){
            console.log("'%s' was a hit pushing to hits array",found);
            hits.push(found);
        }
        else{
            console.log("'%s' was a not hit",found);
        }