Unlike classical languages like C# and Java, JavaScript does not have a true class. It utilizes linking objects together in order to inherit properties. Every single object that you create, unless specified not to, is automatically linked to the corresponding global object prototype.
We also have the ability through utility functions and other methods to link objects together to share functionality. This lesson walks through a simple implementation of this inheritance paradigm and attempts to show how prototypes are used.
Why do people call proto the "dunder" prototype? I tried to google this, but I could not find anything useful.
My guess is "dunder" is short for "double underscore." So "dunder proto" would be a quick way to say "proto" instead of "double underscore proto double underscore."
@Ed is correct!
Just for clarity,
The next-in-line prototype object through the Dunder property is the global object prototype object that all objects are given when no prototype is specified or mutated otherwise.
Could you please explain what 'mutated otherwise' part means? I have the idea that this is about the case when another object (Object.create, the inheritance of classes) is assigned as Dunder proto rather than given by default when no prototype is specified.
Could you please explain what 'mutated otherwise' part means?
This is how you could mutate that next prototype:
const a = {}
a.__proto__ = {}
Now looks very different, now appear [[prototype]] with methods, and inside the dunder proto.. why?