JavaScript 回调函数

回调:就是将一个函数作为参数传递给另外一个函数,在另外一个函数里面使用函数

示例如下:

function testParent(str){
    str()
} ;
function testSon(){
    console.log("Hello")
} ;
testParent(testSon);//Hello
posted @ 2018-06-15 12:10  大雄是个好青年  阅读(104)  评论(0编辑  收藏  举报