function Person (name, eyeColor, age) {
this.name = name;
this.eyeColor = eyeColor;
this.age = age;
this.updateAge = function () {
return ++this.age;
};
}
let person1 = new Person("kevin", "blue", 34); // normalli would have to return something but as im
creating a new object
let person2 = new Person("tom", "brown", 64);
console.log(person1);
Normally if i wanted let person1 to equal something from inside the function i would have to return something to it. Why do i not have to do that when creating a new object constructor. if i console.log person 1, it returns person 1 to me. Whereas if i were normally calling a function i would need it have to return something to me for that to be the assignment value of the variable. Also why are we returning from the method? But we dont return from inside the constructor function
thanks all