3 ms·
The point is you don't need to know though. It's called __proto__ exactly because it's something internal that the programmer of course can have some fun with i
by nosianu 4y ago
The point is you don't need to know though. It's called __proto__ exactly because it's something internal that the programmer of course can have some fun with if they so choose, but it is unnecessary for using it. Unless you do extreme meta- stuff, but that is very far from normal programming and should be done by few and very sparingly and well-targeted and triple-checked.
I mean, for the advanced programmer knowing things about internal workings of the ECMAScript spec and of actual runtimes - most such bog posts are about V8, covering Chrome, Edge (new), node.js - are good to know, such as what is an Execution Context, an Execution Stack, and what is a Scope Chain and how are they implemented. Or, what happens internally when you modify an object's structure by adding or removing properties. Or, what happens when you call a function with different types and numbers of parameters, how /why this destroys internal optimizations. Most programmers will have only a fuzzy, if any, understanding of those though, and that's fine.
Even before "class" was introduced into Javascript people were constructing "classes" left and right, using the prototype, and many (most?) did not know of or did not use __proto__. The latter is used internally during runtime, it is not something you need to manipulate. Your "interface" is the `prototype` property (see https://stackoverflow.com/a/9959753/544779 https://stackoverflow.com/a/9959753/544779).
Reading the ECMAScript spec for someone thus far only well-versed in MDN as Javascript documentation feels quite weird, there's some learning curve required, new words, new concepts. But that's because now you opened the hood and are looking at the gears and the engine of the language.
The basics of some event loop internals, such as what microtasks are, are much more important to know. Asynchronous issues catch people more often and are much harder to debug.