7. What if choice1 is paper, syntax error


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

where? '-'


#2

according to the {} this is a full if/else if/else statement so you get an error when the next thing is another else if. So be careful and have a look at how you handled it for the next cases.


#3

@systemrunner93699 take a look at your code below I have commented where you had errors

var compare = function(choice1, choice2){
    if (choice1 === choice2){
        return "The result is a tie!";
    }
    else if (choice1 === "rock"){// you were missing this brace
        if (choice2 === "scissors"){
        return "rock wins";
        } 
        else{
        return "paper wins";
        }
    }//you were missing this brace
    
     //in this block you wrote choise1/choise2
     //it should rather be choice1/choice2
     else if (choice1 === "paper"){
        if (choice2 === "rock"){
            return "paper wins";
        }
        else{
            return "scissors wins";
        }
    }
     //in this block you wrote choise1/choise2
     //it should rather be choice1/choice2
     else if (choice1 === "paper"){
        if (choice2 === "rock"){
            return "paper wins";
        }
        else{
            return "scissors wins";
        }
    }
}; // added the semicolon here