Skip to content

Commit 3b45f5d

Browse files
committed
password checker task
1 parent 239699e commit 3b45f5d

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Already have the password stored in a variable
2+
const password = "Mattcarolus10"
3+
4+
// Receive the value which the user entered
5+
function checkPassword(userInput) {
6+
7+
// Compare the two values
8+
if (userInput===password) {
9+
10+
// If they match print "Correct password entered"
11+
console.log("Correct password entered ")
12+
}
13+
14+
else {
15+
// If they don't match print "Incorrect password, please try again"
16+
console.log("Incorrect password, please try again")
17+
}
18+
19+
}
20+
checkPassword("Mattcarolus")

0 commit comments

Comments
 (0)