From the new MDN docs it says:
The new keyword does the following things:
- Creates a blank, plain JavaScript object.
- Adds a property to the new object (
__proto__) that links to the constructor function's prototype object
How exactly is the prototype defined then? My thought was it would be:
- If it's in a function (not using the classkeyword), it would lookup to find if there is a[Constructor].prototypedeclared somewhere and use that, and if not it would fallback to...(not sure?). As an example if the constructor is namedRangeit would lookup to see ifRange.prototypeis defined and use that as the prototype.
- If it's in a classthen it would use every method or property to build the prototype up.
Is that more-or-less a correct understanding, or what might I be missing?
 
     
    