Exercise 6 · Chapter: ConditionsRequired+50 XP
Fix the Comparison
This program uses = instead of === for comparison, so it thinks every password is correct. Fix it!
Example input: secret
Expected output: Correct!
Need a hint?
3 available · costs 5 XP each
javascript
let password = prompt();
if (password = "secret") {
console.log("Correct!");
} else {
console.log("Wrong!");
}
Output
Run your code to see the output here.