The issue with Javascript is that you must place "the rest of it" within a callback in order to "freeze" a calculation and have the "rest of it" execute later (asynchronously).
Say, for instance, that I wish to execute the following code:
x = getData();
y = getMoreData(x);
z = getMoreData(y);
...
What would happen if I wanted to make the getData methods asynchronous so that I could execute other code while I waited for their data to return? The only solution in Javascript would be to completely rebuild everything that interacts with an async computation in continuation passing style:
getData(function(x){
getMoreData(x, function(y){
getMoreData(y, function(z){
...
});
});
});