js中 匿名函数作为参数执行,但是我要返回匿名函数中运算产生的值,应该怎么写?

2025-05-14 00:27:20
推荐回答(1个)
回答1:

function test(){
   var x;
   func("test",function(data){
      x = data.value;
   });
   alert(x);
}