Make a Person
I had some difficulties with this exercice, because:
1- I thinked I had need three setters and three getter. So I refered me to this lesson which talk about this where the “set” and “get” are used:
Use getters and setters to Control Access to an ObjectPassed
In this exercice it’s like “this.setxxxx” is a nother way to make a setter and I don’t remember in wich lesson we studied this.
Is it the good maner to do in the real life ?
Which way is the better between “set”, “get” and “this.nameOfMethode” ?
2- Aso I thinked that in generaly, functions (Methodes) had to add to the constructor’s proptotype as explain in this lesson:
" Functions are added to Bird’s prototype"
Add Methods After Inheritance
If I consider setter and getter as Methode, Wouldn’t it have been better in real life to put the “this.methode” in the prototype ?
To summarize, I would like to understand how it would have been done in real life ?