Callback functions play an important role in many frameworks, including JQuery. Calling a Function as CallBack is an interesting topic in Javascript. It can be Done as: function action (callback, x, y) {
var result = callback(x, y);
alert(result);
}
function add(x, y) {
return x + y;
}
function multiply(x, y) {
return x * y;
}
action(add, 2, 3); // => 5
action(multiply, 2, 3); // => 6