執行內部函數,我想執行的內部功能,但我很努力理解爲什麼回來爲未定義通過返回函數名
object.method2();
var object = {
method1 : function(){
return function(){
innerFunction();
}
},
method2 : function(){
function innerFunction(){
alert('I am showing as not defined but I want to be executed')
}
executeInnerFunction = object.method1()
executeInnerFunction();
}
}
+1代碼示例 – Tom