pass parameters in function call javascript code example
Example 1: javascript pass function as parameter
//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);
Example 2: how to create a function with parameters in JavaScript
function name(param, param2, param3) {
}