-1
我似乎无法访问由调用函数定义的参数 - myfunction在被调用的函数method2中。任何想法我做错了什么。我有一种感觉,我正在陷入我不确定的倒闭之中。Javascript范围问题在运行时无法访问变量事件
function myfunction(){
var config = { alpha: 1, beta:2, charlie:3}
$(someelement).on('event', function(a,b,config){
//a and b are published established params of the event im using
//config is something im adding
method2(a, b, config);
});
}
function method2(a,b,c){
//param c is undefined why ??
}