Javascript kod bloğunu oluşturmak:
function Shape() {}
Shape.prototype.name = Shape;
Shape.prototype.toString = function() {
result = [];
if(this.constructor.uber) {
result[result.length] = this.constructor.uber.toString();
}
result[result.length] = this.name;
return result.join(', ');
}
function twoDShape() {};
twoDShape.prototype = new Shape();
twoDShape.prototype.constructor = twoDShape;
twoDShape.uber = twoDShape.prototype;
twoDShape.name = twoD Shape;
var a = new twoDShape();
console.log(a.toString());
Ben neden bilmiyorum ama onu çalıştırdığınızda, firefox donma olduğunu. Ben bunu anlamaya saat çalışıyorum. Ve benim tahminim benim kodda sonsuz döngüler olacak ve eğer durumda bir yerde yaşıyor, ama ben bunu bulamadık gerektiğidir. Birisi bu baş ağrısı çıkmama yardımcı olabilir. Teşekkür ederim!