1

Per MDN here, it is suggested that Teacher.prototype.constructor should be reset to Teacher. Teacher inherits from Person object using prototypal inheritance. I am trying to understand what can possibly break if this step is not followed.

Here is a codepen that I setup, where I did not follow this step, however things seem to work fine. I think I am missing something. Can someone please help?

bp4D
  • 915
  • 12
  • 20
  • 1
    It’s expected that an object’s `constructor` property reflects its constructor. I’m not aware of anything built-in that requires this, but you may as well do it. (Other tools might need it; for example, `Error.captureStackTrace(this, this.constructor)` in a custom error type.) – Ry- May 13 '18 at 23:01

0 Answers0