Quiz: Assign or Compare?

Someone typed a wrong password, 1234, but the program lets them in. Click the line with the mistake.

const correctPassword = "kitten42";
let typedPassword = "1234";

if (typedPassword = correctPassword) {
    console.log("Welcome");
} else {
    console.log("Wrong password");
}

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

5/13