Skip to content

Instantly share code, notes, and snippets.

@Sufuninja
Created August 12, 2015 18:37
Show Gist options
  • Save Sufuninja/a55c08e7dbbde23c71c7 to your computer and use it in GitHub Desktop.
Save Sufuninja/a55c08e7dbbde23c71c7 to your computer and use it in GitHub Desktop.
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