Javascript Prototype changed but still accessing old methods

I was learning inheritance and Prototype chaining. I was stuck after seeing this behaviour of resetting the constructor function’s prototype inside the function itself. On instantiating Case const Person = function (name,age) { this.name = name; this.age = age; } Person.prototype.calcAge = function () { console.log(`My age is ${2022-this.age}`); } const Student = function (name,age,course)… Read More Javascript Prototype changed but still accessing old methods