I am using the following test code:
function Test() {
}
Test.prototype.MyMethod = {
a: function() {
},
b: function() {
}
}
And to run, I just do:
var test = new Test();
console.debug(test);
In the firebug console, I expand the object that was printed, and look inside __proto__:
It contains a seemingly infinite constructor chain -> prototype:
+MyMethod
-constructor
-prototype
+MyMethod
-constructor
-prototype
+MyMethod
-constructor
etc. Did I do something wrong? Why does the prototype chain seem endless?
source
share