Callback functions is a theory derived from functional programming and specifies the use of functions as arguments.
PARAMETERS TO CALLBACK FUNCTIONS:
We can also pass parameters to callback functions, just similar to any other function. In the below instance we pass as a parameter the name of the author of the function.
var author = “FF”;
alert(“namedCallback() called by “+param);
MULTIPLE CALLBACK FUNCTION:
Multiple callback functions can be used as parameters of another function.
Var someUlr = …;
WHY DO WE NEED CALLBACKS?
As the user would expect, the function first is executed first, and the function second is executed second.
You can now understand what a callback is and how it works. This is just the tip of the iceberg with callbacks, there is still a lot more to learn!