R/p/s-7


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-Bthev-mskY8/1/3?curriculum_id=506324b3a7dffd00020bf661#

SyntaxError: Unexpected token else


Replace this line with your code. 
var compare = function (choice1,choice2){
    if(choice1 === choice2){
        return"The result is a tie!";
        
}else if (choice2 === "scissors"){
        return"rock wins"
        
}else{
    return "paper winds";
        }   
    else if (choice1 === "paper"){
        
        if(choice2 === "rock"){
            return"paper wins"
        }
    }else{
        return"scissors wins"
        };
        
        
    }


#2

you have much more mistakes.but i'll only focus on main things.

else if (choice2 === "scissors"){
        return"rock wins"

is it possible? where is choice1???

return "paper winds";  // wins not winds

your code should have this basic outline:

else if(condition){
 if(condition){
   // do something 
 }
else{
   // do something  
}
}

Note:make sure you have close all brackets.


#3

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