I need some help


#1

Is my code wrong or something? Because the if statement is always return to me "33", not "44", here is the code:

var answer = prompt("What do you like?\nCake?\nCandy?")

var responses = {
"Cake" : "But I want coke, you suck",
"Candy" : "Coke is better",
default : "FK"
};

alert(responses[answer] || responses.default)

if (answer = responses.default) {alert(33)}
else {alert(44)}

I want all the choice in variables "responses" (except the default) return to me the else in the if statement and vice versa.


#2

if (answer = responses.default)

Check this if statement and see if if you can find the error, Cheers!

~lolman


#3

Check. But I cant find the error. Anyway help me plz