Calling a callback in javascript

前端 未结 1 1731
予麋鹿
予麋鹿 2021-01-11 15:45

I am not so strong in javascript.

I have a common function that I call from many parts of my code passing them some parameters.

Can somebody help me on

相关标签:
1条回答
  • 2021-01-11 16:15

    It is actually quite simple.

    function callback() {
        alert("I am in the callback!");
    }
    
    function work(func) {
        alert("I am calling the callback!");
        func(); 
    }
    
    work(callback);
    
    0 讨论(0)
提交回复
热议问题