I studied javascript inheritance for a couple of days, and although I have made quite a bit of progress, there are some things that I do not quite understand yet.
For example, I find this behavior quite confusing:
var Employee = function Employee() { this.company = 'xyz'; }; var Manager = function Manager() { this.wage = 'high'; }; var m = new Manager(); m;
m __proto__ property points to an object that is not a prototype of Manager . This is a little illogical, given that:
An object inherits properties, even if they are added to its prototype after creating the object.
Adapted from JavaScript: The Final Guide, Fifth Edition, David Flanagan
Is it possible to apply this behavior to the above case?
Can anyone clarify?
javascript inheritance prototype
asymmetric
source share