What i am doing wrong? "Your "if" statment"


i'm stuck in the "Your "if" statment" exercice

my error is : Oops, try again. Remember how to check the value of an element in an array? You simply do arrayName[i]. Check the Hint if you need help!

my code:

/*jshint multistr:true */

var text = "Hey, how are you \
doing? My name is Emily.";

var myName = "Charly" ;

var hits = [];

for(var i = 0; i < text.length; i++)
    if(myName[i] = "C")


HI this line

 if(myName[i] = "C")

instead of myName[i] you should put text[i] then instead of teh = you should put ===
to asign value to a variable you use the =
to compare two value you use == or ===


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