Skip to content

Commit b4c386b

Browse files
committed
created variable response "as the outcome"
1 parent 8d227cd commit b4c386b

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

‎prep/passwordChecker.js‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99

1010
// 2 Multiple outcomes
1111
const password = "secretword123";
12-
const userInput = "override";
12+
const userInput = "thisiswrong";
1313
const adminPassword = "override";
14+
const response = "";
1415

15-
if (userInput === password){
16-
console.log("Correct password entered");
16+
if (userInput === password){
17+
response = "Correct password entered";
1718
} else if (userInput === adminPassword){
18-
console.log("Admin access granted")
19-
}else {
20-
console.log("Incorrect password!");
21-
}
19+
response = "Admin access granted";
20+
} else {
21+
response = "Incorrect password!";
22+
}
23+
24+
console.log(response);

0 commit comments

Comments
 (0)