In the following code snippet, how can I access A.prototype.log inside B.prototype.log ?
function A() {} A.prototype.log = function () { console.log("A"); }; function B() {} B.prototype = Object.create(A.prototype); B.prototype.constructor = B; B.prototype.log = function () {
I know that I can just write A.prototype.log.call(this) , but I thought there might be a more elegant way that allows me to call it a relative way, like calling the log method of the next higher instance in the prototype chain. " Is this possible?
source share