#6 Can't find the problem?


#1


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

It says, "Oops, try again. Your code returned 'The result is a tie!' instead of 'paper wins' when the inputs are rock and paper "


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";
        }  
    }
};


#2

The result of assignment is the assigned value.

var a;
var b = (a = 5);
console.log(b);  // 5

#3

Do you say the part——>https://www.codecademy.com/en/courses/javascript-beginner-en-Bthev-mskY8/1/2?curriculum_id=506324b3a7dffd00020bf661?


#4

OK. I have known how to fix my code.
if (choice1 === choice2)

should be

if (choice1 === choice2)


#5

What is the difference between the two?