Asynchronous callback nightmares stalk JavaScript developers, both in their traditional hunting grounds in the browser and in their new territory on the server.
The smart folks at jQuery have figured out better ways to deal with these terrors, building a new approach called deferreds into their library. It works on both the client (of course!) and on the server (for the Node folks). Callbacks are added to Deferred objects corresponding to outstanding asynchronous calls. When the result of the asynchronous tasks become known, the callbacks are run. As a distinct object, with simple formal semantics for handling future results, Deferreds provide concise and flexible expressive power to programmers working with asynchronous events.