Created
August 12, 2015 18:37
-
-
Save Sufuninja/a55c08e7dbbde23c71c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var userTable = {JOHN: "PIZZA", SUE: "LADY", DANNY: "SCIENCE"} | |
var userName | |
var password | |
function _getName() { | |
userName = prompt("Login:").toUpperCase(); | |
}; | |
function _getPassword() { | |
password = prompt("Login:").toUpperCase(); | |
} | |
function _login(userName) | |
{ | |
for (var i in userTable) | |
{ | |
if (userName === i) | |
{ | |
console.log(userTable[userName]); | |
_getPassword(); | |
}; | |
}; | |
if (userTable.userName === password) | |
{ | |
console.log("yes"); | |
}; | |
}; | |
_getName(); | |
_login(userName); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment