function Account(password, email)
{
this.password=password;
this.email=email;
}
function createAccount()
{
var username="Moshiko22";
var password="1112"
var email="[email protected]";
username=new Account(password, email);
}
The first function is a constructor. Assuming 'username', 'password' are user entered, I want to create an account object with the name the USER entered. (as in the object would be the 'username' the user has entered). I know why what I've done doesn't work, but I don't know how to actually get it done. Thanks in advance!
Sorry for being unclear: the user enters username, password and email. the password and email are just 2 properties in the object 'Account'. The username is what I want as the object itself.
usernameandpassword, but in another place you're usingpasswordandemail...?