__proto__ vs prototype
__proto__: An internal property (getter/setter) available on every object that points to its prototype. It is deprecated in favor ofObject.getPrototypeOf()/Object.setPrototypeOf()but still widely used.prototype: A property that exists only on constructor functions. It defines the prototype of objects created by that constructor when usingnew.
Code Example
Section titled “Code Example”function Animal() {}Animal.prototype.sound = "grrr";
const dog = new Animal();console.log(dog.__proto__ === Animal.prototype); // trueconsole.log(dog.prototype); // undefined (dog is not a constructor)