//函数可以作为参数使用,如果一个函数作为参数,那么我们可以叫这个函数为回调函数
//也就是说:只要是看见一个函数为参数了,那就是回调函数
function sayHi(fn) {
console.log("你好,世界");
fn();//
}

function sayYes() {
console.log("是的,很好");
}
sayHi(sayYes);



// //函数定义        ----------->   函数参数
// function cook() { function cook(x,y){ --- 小括号为参数
// var x=100; var sum=x+y;
// var y=200; console.log(sum);
// var sum=x+y; }
// console.log(sum); 函数调用
// } cook(值1,值2); --- 用户赋值自接传入
// //函数调用
// cook();

相关文章:

  • 2022-01-06
  • 2021-11-18
  • 2021-11-27
  • 2022-12-23
  • 2021-08-05
  • 2019-02-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-27
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-02-22
  • 2021-11-09
相关资源
相似解决方案