JavaScript 回调函数

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

示例如下:

function testParent(str){
    str()
} ;
function testSon(){
    console.log("Hello")
} ;
testParent(testSon);//Hello