js回调函数传参数,简单代码蕴藏大智慧 :D
执行效果,弹出数字3
function a(callback){
var m = 1;
var n = 2;
alert(callback(m,n));
}
function b(m,n){
return m+n;
}
a(b);
执行效果,弹出数字3