Benim kod uzanan hata aşağıdaki gibidir: Ben SpecificExample
Example
uzanır istiyorumJavaScript - nesne
function Example(){}
Example.myMethod = function(){};
function SpecificExample(){}
SpecificExample.prototype = Object.create(Example.prototype);
SpecificExample.prototype.constructor = SpecificExample;
. Bu kod neden çalışmıyor?
'Example.myMethod = fonksiyonu() {};' Yapıcınızda bağlı bir fonksiyon, bir prototip yöntem olup, 'Örnek kullanmaktır. prototype.myMethod = function() {}; ' – somethinghere