Linked Prototype Diagram
diagramThe dotted lines are implied relationships.
It's "nonsense" that
b1
's implied .constructor
is Foo()
.The above diagram is actually not complete. There are a lot of built-in objects and functions provided by the language. So the real relationship is much much more complex. The good news is that there's a lot of consistency:
All functions delegate up the prototype chain so they can use
diagramTo take away:.call()
, .apply()
, .bind()
etc.:In these diagrams the functions
Foo()
, Bar()
are just distractions, what we care about are the Object
s.