I think if you're working with classes then dealing with prototypes directly is not necessary and might be confusing. Person example can be rewritten without direct access to the prototype chain:
In this case the birthYear property is created in the person instance, not in the prototype while calculateAge and incrementBirthYearByOne are in the prototype.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think if you're working with classes then dealing with prototypes directly is not necessary and might be confusing.
Person
example can be rewritten without direct access to the prototype chain:In this case the
birthYear
property is created in the person instance, not in the prototype whilecalculateAge
andincrementBirthYearByOne
are in the prototype.