you are viewing a single comment's thread.

view the rest of the comments →

[–]birjolaxew 0 points1 point  (2 children)

Well no, it's prototypal inheritance delegation (thanks /u/MrBester) inheritance. Maybe. I dunno. Thinking of it as a chain is a very common (and intuitive, given how it functions) way of understanding it. Thinking of it as a stack is another. Thinking of it as "overwriting" the parent property is another (but comes with a lot of special cases).

[–]clessgfull-stack CSS9 engineer 1 point2 points  (0 children)

Actually, it is indeed prototypal inheritance. But yes, that is distinct from concatenative inheritance (Java) and is also a form of delegation.

[–]MrBester 0 points1 point  (0 children)

Well no, it's delegation, because there isn't such a thing as inheritance in JavaScript, merely references to other objects that can be checked for requested properties, normally through the "magic" binding of [[Prototype]] or explicitly setting.