我将如何制作一个对象,我可以指示在某些时候做什么。见示例:
function bar(){
// call/execute the start() code
// do something
// do some other thing
// do something else
// call/execute the end() code
}
foo=new bar();
foo()
.start(function(param){
console.log("start");
})
.end(function(param){
console.log("end");
})
慕田峪4524236
慕侠2389804
相关分类