Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions starter-code/login.js
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
console.log("login.js loaded");

var userLogin = {userName: "admin", password: "abcd1234"};

for (i = 0; i < 3; i++) {
var userPassword = prompt("Enter password for " + userLogin.userName);
if (userPassword == userLogin.password) {
alert("It's a match!");
break;
} else {
alert("Try again!");
};
};
28 changes: 28 additions & 0 deletions starter-code/security_questions.js
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
console.log("security_questions.js loaded");
security_questions = [
{
question: "What town were you born in?",
expectedAnswer: "San Francisco"
},
{
question: "What is your pet's name?",
expectedAnswer: "Milo"
},
{
question: "What year were you born?",
expectedAnswer: 1985
}
]


var answer = ""


for (var i = 0; i < security_questions.length; i++) {
answer = prompt(security_questions[i].question);
if (answer == security_questions[i].expectedAnswer) {
alert("It's a match!");
break;
} else {
alert("Try again!");
};
};
12 changes: 12 additions & 0 deletions starter-code/sing.js
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
console.log("sing.js loaded");

var song = {
verse1: "5 bottles of beer on the wall",
verse2: "5 bottles of beer!",
verse3: "Take one down and pass it around,",
verse4: "4 bottles of beer on the wall!"
};

console.log(verse1);
console.log(verse2);
console.log(verse3);
console.log(verse4);