1//passing a function as param and calling that function
2function goToWork(myCallBackFunction) {
3 //do some work here
4 myCallBackFunction();
5}
6
7function refreshPage() {
8 alert("I should be refreshing the page");
9}
10
11goToWork(refreshPage);