Answers for "... as parameter js"

5

... as parameter js

//passing a function as param and calling that function
function goToWork(myCallBackFunction) {
    //do some work here
    myCallBackFunction();
}

function refreshPage() {
    alert("I should be refreshing the page");
}

goToWork(refreshPage);
Posted by: Guest on July-31-2019

Code answers related to "Javascript"

Browse Popular Code Answers by Language