90% of the front-end or JS programmers or teachers do not understand JavaScript more than this
to the phone.
But all the brown one-way arrow chains in this diagram are the prototype chains of JavaScript (color annotations are critical to understanding the JS prototype chain)
Each of the __proto__ constructor. Prototype is an internal object so the painting is for brevity.
For example, if you consider __proto__ as an internal object into a
The prototype chain is
Constructor and prototype if you put it in the appropriate position as an internal object, it's going to be a marijuana regiment. I can't remember anything.
Please look at This is the actual JavaScript prototype chain diagram Hey
The prototype chain is invisible most of the time (__proto__ is visible in Firefox Nodejs) so the graph is back to
The three features of the previous figures
1. All objects are on the prototype chain
2. Except null each object has a unique __proto__ prototype object
3. In addition to NULL, Object.prototype, the prototype object of other objects is unreachable. __proto__ operation Access but the prototype property of a constructor (function) on the prototype chain can be accessed
JS Coder Most of the time to face is
Elegant, huh:-()
All JavaScript heavy codes are the elements of the above diagram, but you have to have at least
If even this picture is not easy to remember the simplest of the Iron Triangle JavaScript 99% is the result of the Metamorphosis
The shadow part does not move (of course you are willing to make a kavascript is also personal freedom but that's not JavaScript) will destroy the structure of the prototype chain and the sealing of JS programming for the Chaigai of the prototype chain is the non-shaded part of the lower left corner
Considering that __proto__ prototype constructor are internal objects,
So the actual diagram should be
JavaScript's prototype chain diagram