//assignment
var user_name = prompt("Who's there? ");
//when enter Admin
if (user_name == "Admin") {
var user_password = prompt("Password? ");
user_password == "TheMaster"
?
alert("Welcome!") //if password is True
:
user_password == null
?
alert("Canceled") //if enter cancel
:
alert("Wrong Password"); //if enter other
}
//when click cancel
else if (user_name == null) {
alert("Canceled");
}
//when enter other
else {
alert("I don't know you");
}