var abc = {
'a': 10,
'b': 10,
c: function() {
//like if I have many many functions in c
init_a();
multiple();
function init_a() {
abc.a = 30;
}
function multiple() {
alert(abc.a * abc.b);
}
function minus() {
alert(abc.a - abc.b);
}
return {
function myalert() {
var result = abc.a + abc.b;
alert(result);
}
}
},
d: function() {
abc.c.myalert(); // ??? error??
abc.c().myalert(); // ??? error?? **it run all functions in c but not just myalert, strange things happening...
}
}
abc.d();
在函数 d 中调用“myalert()”函数的正确语法是什么?