function a() {
this.a = function () {
console.log("In A");
}
this.b = function () {
console.log("In B");
}
this.c = function (cb) {
console.log("In C ");
}
this.d = function (cb) {
cb();
console.log("In D");
}
this.d(function () {
this.a();
this.b();
this.c();
});
}
var A = a();
IN A
IN B
IN C
IN D
var A = new a();
IN A
IN B
IN C
IN D
IN B
IN C
IN D
有人能解释一下这是如何运作的吗?
此外,有关链接的任何建议,我可以找到这些有趣的问题/问题?
提前谢谢:)