Is there any difference between these 2 apart from the resolving constructor?
var Person = function(living, age, gender) {
this.living = living;
this.age = age;
this.gender = gender;
this.getGender = function() {
return this.gender;
};
};
var Person = function Person(living, age, gender) {
this.living = living;
this.age = age;
this.gender = gender;
this.getGender = function() {
return this.gender;
};
};
Both could be invoked using
var p = new Person("Yes",25,"Male");
The first one resolves to function() where the latter resolves to person(), but I would like to know if there is any advantage of using one over the other