回调函数 当一个函数A作为参数传给另一个函数B,在函数B中被执行,这个函数A叫做回调函数 function fn(a){ var num = 999; a(num); } fn(function(n){ console.log(n); //999 })