Passing arguments to a JavaScript callback function

In JavaScript, callback functions are used to perform an action or operation after another operation has occurred. The mechanics of a callback rely on the fact that everything in JavaScript is a first class object. This fact allows you to pass functions as arguments to another function. The latter function can then invoke that function at a predetermined point in the program.