opl*_*opl 8 javascript firebug prototype
我使用以下测试代码:
function Test() {
}
Test.prototype.MyMethod = {
a: function() {
},
b: function() {
}
}
Run Code Online (Sandbox Code Playgroud)
为了运行它,我只是在做:
var test = new Test();
console.debug(test);
Run Code Online (Sandbox Code Playgroud)
在firebug控制台中,我展开了打印的对象并查看__proto__:
在那里找到一个看似无穷无尽的构造函数链 - >原型:
+MyMethod
-constructor
-prototype
+MyMethod
-constructor
-prototype
+MyMethod
-constructor
Run Code Online (Sandbox Code Playgroud)
等等.我在这里做错了吗?为什么原型链似乎无止境?
| 归档时间: |
|
| 查看次数: |
1108 次 |
| 最近记录: |