dimanche 10 avril 2016

Won't Print Object Property

function User()
{
    this.username = null;
    this.password = null;
    this.first = null;
    this.last = null;
}

var userList = new Array();

userList[0] = new User();
userList[1] = new User();
userList[2] = new User();

userList[0].username = "Georgie19";
userList[1].username = "PaulC-87";
uesrList[2].username = "JamesHat";

userList[0].password = "georgepass101";
userList[1].password = "adminpaul-13";
userList[2].password = "jamesH7";

userList[0].first = "George";
userList[1].first = "Paul";
userList[2].first = "James";

userList[0].last = "Hordin";
userList[1].last = "Corman";
userList[2].last = "Haquel";

document.write(userList[0].username);

When I put this into my browser, it comes up blank. I have tried getting rid of the things I'm not using, and it automatically works. I really can't figure it out. I'm suspecting it is a syntax error that I simply can't find, please help. PS: It's not a problem in my HTML




Aucun commentaire:

Enregistrer un commentaire