Async - martinbalke-401-adavanced-js/seattle-javascript-401n14 GitHub Wiki

Readings Class 03 : Async

Many people find the concept of writing and understanding synchronous code to be difficult for multiple reasons. I think the biggest one is that our brains do not run synchronously. We handle our environment by switching from one asynchronous task to another back and forth very quickly while running small processes subconsciously.

One of the other more difficult things to deal with and understand when writing synchronous code is what's known as inversion of control. What this means is that while executing a code block you make a call to an outside source which is not part of your code base (an API call, an AJAX request) and the way that this outside source handles your request and the response that it gives you once it completes can have drastic effects on the order that your code will execute, as well as the result you will receive from it.