Rock, paper, scissors- what is choice1 is rock


#1

Hi,

I'm stuck at this stage and I don't know why.

var compare = function(choice1,choice2) {
    if(choice1 === choice2);
    return"The result is a tie!";
}
else if (choice1 === "rock")
    {
    if(choice2 === "scissors")
    {
    return "rock wins"
    }
    (choice2 === "paper")
    {
    return "paper wins"    
}

#2

if(choice1 === choice2);

you should have { instead of ;

also

    (choice2 === "paper")
    {
    return "paper wins"
}

it doesn't make sense. use else instead

else if(codition ){
if( condition  ){
return something 
}
else{

return something
}
}

#3

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