JavaScript Callbacks

A callback is a method designated to handle the response of an AJAX call once it gets back to your method. JavaScript methods are treated as first-class objects, which means that they can be passed around just like objects, and they can be attached to all manner of events. Callbacks are used to prevent operation being blocked until the initial operation is completed. Callbacks are useful when the function needs to perform actions before the callback is executed, or when the function does not have meaningful return values to act on.