S
S
Sergey Saltanovich2020-04-29 21:15:43
JavaScript
Sergey Saltanovich, 2020-04-29 21:15:43

Why use prototype on a constructor function property when you can set it via this.__proto__?

Hello, what is the difference between:

function Obj ( ) {
this.__proto__ = new(some object);
}

and

function Obj ( ) {
Obj.prototype = { __proto__ : (any object).prototype };
}
???

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor, 2020-04-29
@Sulti

This question has already been asked so many times, it seems you have not tried to google.
What is the difference between __proto__ and prototype

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question