Name your functions! - Having named functions makes your code much easier to read and keep track of, especially when debugging or making changes!
Modularize! - If you are using nodejs or requirejs you should be keeping related functionality in separate module files then
require-ing them as they are needed. This makes the code easier to read and keep track of for other developers, and avoids polluting the global namespace.
Check out the examples over at callback hell for more information, and hopefully you will be able to avoid the fiery depths!
- Wrangle Async Tasks With JQuery Promises – NetTuts+