Che*_*tan 10 javascript methods class
我有这个:
var Test = new function() {
this.init = new function() {
alert("hello");
}
this.run = new function() {
// call init here
}
}
Run Code Online (Sandbox Code Playgroud)
我想init在跑步中打电话.我该怎么做呢?
使用this.init(),但这不是唯一的问题.不要在内部函数上调用new.
var Test = new function() {
this.init = function() {
alert("hello");
};
this.run = function() {
// call init here
this.init();
};
}
Test.init();
Test.run();
// etc etc
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
32964 次 |
| 最近记录: |