cade galt 0 cade galt 0 - 1 year ago 125
Javascript Question

What is the difference between __proto__ and prototype?

I'm trying to extend my library to include inheritance, but I don't understand the difference between




in the context of objects, functions, and instances. ( the dup does not cover objects )
I played around with the and found some interesting behaviors:

enter image description here

Answer Source

One thing the marked duplicate does not mention, is that functions implicitly have a prototype property, while object literals do not.

And to re-iterate prototype is not implicitly available on the instances themselves, but on __proto__ is.