Hey, I currently am having trouble trying to get this to work. Here's a sample code of what I am trying. A lot has been taken out, but this should still contain the problem. I have an object, user, and an array, player. I am trying to make an array with the players in it, here:
function user(name, level, job, apparel)
{
this.name = name;
this.state = "alive";
this.level = level;
this.job = job;
this.apparel = apparel;
}
player = new array();
player.push(new user("Main Player", 1, 1, "naked"));
document.write(player[0].name);
But it's not working, nothing's being echo'd. What am I doing wrong?
I tried this and worked:
instead of:
You have a typo in your code.
Change
to
I would do
instead of
As a sanity check, try doing:
Well, you've got an error. It's not
array
butArray
.