What is a callback function?

前端 未结 21 2409
耶瑟儿~
耶瑟儿~ 2020-11-21 23:01

What is a callback function?

21条回答
  •  清酒与你
    2020-11-21 23:41

    Callback Function A function which passed to another function as an argument.

    function test_function(){       
     alert("Hello world");  
    } 
    
    setTimeout(test_function, 2000);
    

    Note: In above example test_function used as an argument for setTimeout function.

提交回复
热议问题