3. Prototypal Inheritance creating class function()

01

Behind the scenes when creating a class, javascript creates an empty function?? We can add methods to this empty function with .prototype

function Person() {}
Person.prototype.talk = () => {
    return 'Talking'
}
const me  = new Person()
me.talk()

01

console me and see that the talk() method is within its .__proto__ which contains the methods of it's parent class/function Person.

me.__proto__
Person.prototype