What is the difference between this...
function Person(name, age, sex) {
this.name = name;
this.age = age;
this.sex = sex;
}
and this...
function Person(name) {
this.name = name;
this.age = age;
this.sex = sex;
}
and this...
function Person() {
this.name = name;
this.age = age;
this.sex = sex;
}
Thanks!
David, I have a piece of code for a game I am building that looks like this...
function Player(node){
this.node = node;
this.grace = false;
this.replay = 3;
this.shield = 3;
this.respawnTime = -1;
...
return true;
}
and it does not return a reference error. Its an object for a player in a javascript game I am building...