This question has already been answered:

I am trying to deal with inheritance in js and can’t understand why a prototype is needed if there is __proto__ . As I understood (from the material that I studied), prototype - simply refers to __proto__ , is that so? If so, what is the point of prototype?

Reported as a duplicate at Grundy. javascript Jan 1 '18 at 9:08 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

1 answer 1

The prototype property only makes sense to the constructor

A property named prototype can be specified on any object, but it has a special meaning only if it is assigned to a constructor function.

By itself, without calling the new operator, it does nothing at all, its only purpose is to specify __proto__ for new objects.

Source: https://learn.javascript.ru/new-prototype

  • one
    __proto__ - This is not an object field, and in fact it cannot be specified. These are the getter and setter, which set the value of the inner field, and whose calls are completely replaceable by the calls of other functions - Grundy