Skip to content

Commit b0f2d1e

Browse files
committed
Explaining errors
1 parent a66fb77 commit b0f2d1e

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎prep/passwordChecker.js‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
// const password = "secretword123";
3+
// const userInput = "secretword123";
4+
// if (userInput === password){
5+
// console.log("Correct password entered");
6+
// }else {
7+
// console.log("Incorrect password entered")
8+
//}
9+
10+
// 2 Multiple outcomes
11+
const password = "secretword123";
12+
const userInput = "override";
13+
const adminPassword = "override";
14+
15+
if (userInput === password){
16+
console.log("Correct password entered");
17+
} else if (userInput === adminPassword){
18+
console.log("Admin access granted")
19+
}else {
20+
console.log("Incorrect password!");
21+
}

0 commit comments

Comments
 (0)