Any constructor that can be called with new and has the prototype property can be the candidate for the parent class.
Classes declared with class
and functions with constructor
and an assigned prototype
.
Any constructor that can be called with new and has the prototype property can be the candidate for the parent class.
Classes declared with class
and functions with constructor
and an assigned prototype
.
Evaluating this class results in installing the name function onto Person.prototype, roughly like this: