Not sure what I did wrong, but it draws all colors even with the “if”
You must use === not =.
= and === is not the same thing. = is used to give ‘‘something’’ a ‘‘value’’ and === is used as the equal you are trying to use.
Hey there, looks like your if statements are using the assignment operator
=, instead of the equality operator
if (answer = blue) is assigning
blue to answer, not checking if they are equal. Same with the other if statements. This is why all of them are running their code.
=== and you should get the output you’re looking for.
Hope this helps!
Hey, @CSparks. I see a problem. The problem is: inside the every if statement, you are using assignment operator (=) instead of equality operator (===). Try replace the assignment operator with equality operator.
Hope that helps!